Hi,
I have a datagrid object and I want to access the properties of a cell in a datagird at a given row and column. How can I do this
Thanks,
Hi,
I have a datagrid object and I want to access the properties of a cell in a datagird at a given row and column. How can I do this
Thanks,
Accessing cell properties from DataGrid object
dmcrews4202
dr.xaml
wgreer
Gabriel Petrovay
harryv
Andy Roberts - MSFT
HI,
I'm looking for the same functionality. I need to disable a particular cell(datagridveiw). In which event i need to make the cell as readonly.
venp--
quoi
npvw
n9986
In DataGridView you can access cells by grid[col,row].
In DataGrid there is no cell properties.
Chrisjwood
Hi,bilalso
For DataGrid in NET 1.1, there's no direct property to access a certain cell, but if you want to disable a whole column, you can use the DataGridTableStyle, e.g.:
this.dataGrid1.DataSource = dtBook;//a datatable named "dtBook"
DataGridTableStyle tbStyle = new DataGridTableStyle();
tbStyle.MappingName = "dtBook";
this.dataGrid1.TableStyles.Add(tbStyle);
this.dataGrid1.TableStyles["dtBook"].GridColumnStyles[2].ReadOnly = true;//disable the 3rd column
Hope it helps.
Best Regards.
Ye