Datagrid column name

G

gane

Any ideas on how to assign value to a datagrid cell referencing the column
name?


I would like to assign a value to a datagrid item using the column name
(from web.config file) instead of using something like e.item.cell[1].text
in itemdatabound

Thanks
Gane
 
G

gane

Its is for the display purpose and not indented for editing.
Is that what u mean?

I have something like this in my code.
if(e.Item.ItemType==ListItemType.Item ||

e.Item.ItemType==ListItemType.AlternatingItem)

{


// Get and customize Property Code from locationptr string

DataRowView rv = (DataRowView)e.Item.DataItem;


string strLocation =
Convert.ToString(rv.Row["locationptr"]);//rv.Row.ItemArray[5]);

string[] arrLocation = GetLocation(strLocation,',');

string strStreet = arrLocation[0].ToString();

if (strStreet != "")

{

e.Item.Cells[5].Text = strStreet; // ??

}

Curtis said:
Do you want the datagrid to manage the value once you enter it?

Curtis
Any ideas on how to assign value to a datagrid cell referencing the
column
name?


I would like to assign a value to a datagrid item using the column name
(from web.config file) instead of using something like
e.item.cell[1].text
in itemdatabound

Thanks
Gane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top