I'm working on a RadGrid, and I want to access its rows but it seems it does not have a .Rows
property.
Here's what I have tried until now:
How can I access rgCustomers
's Rows collection? I want to add a button to each row.
To select multiple cells programmatically, set the IsSelected property of the desired cells to true . In this scenario, all four cells are added to the SelectedCells collection of RadGridView. You can access the instances of the selected cells in the SelectedCells collection by their index: C#
The GridView is part of Telerik UI for WinForms, a professional grade UI library with 140+ components for building modern and feature-rich applications.
According to Telerik's documentation,
"Each dynamic row in the grid represents a record from the specified data source. Dynamic rows are represented by the GridDataItem class (a descendent of GridItem).
Each GridTableView has a set of rows (the Items collection) of type GridDataItem."
So you want to use the Items collection of the grid, which is a collection of GridDataItems.
protected void btnLoad_Click(object sender, EventArgs e)
{
rgCustomers.DataSource = odsCustomers;
rgCustomers.DataBind();
foreach (GridDataItem row in rgCustomers.Items)
{
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With