Datagrid column name

  • Thread starter Thread starter gane
  • Start date Start date
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
 
Do you want the datagrid to manage the value once you enter it?

Curtis
 
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

Back
Top