6 Answers, 1 is accepted
0
Hello Anatoliy,
The safest way to retrieve the data object from the source is by looking directly into the source table or view. Generally, you can convert your e.Item to a GridDataItem and take a unique cell value from it that you can use for querying your database. This way, you can ensure that the retrieved data source item is represented by your GridDataItem.
Greetings,
Veli
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The safest way to retrieve the data object from the source is by looking directly into the source table or view. Generally, you can convert your e.Item to a GridDataItem and take a unique cell value from it that you can use for querying your database. This way, you can ensure that the retrieved data source item is represented by your GridDataItem.
Greetings,
Veli
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anatoly
Top achievements
Rank 1
answered on 03 Sep 2008, 04:29 PM
Hi.
I do this:
protected void grid_ItemCommand(object source, GridCommandEventArgs e)
{
GridDataItem Item = e.Item as GridDataItem;
foreach (TableCell item in Item.Cells)
{
string str = item.Text;
}
str == " " for all cells0
Hello Anatoliy,
To see more information on the requested functionality, please refer to the following article - Accessing cells and rows. I hope this information helps.
Kind regards,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
To see more information on the requested functionality, please refer to the following article - Accessing cells and rows. I hope this information helps.
Kind regards,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anatoly
Top achievements
Rank 1
answered on 03 Sep 2008, 04:52 PM
I do this:
protected void grid_ItemCommand(object source, GridCommandEventArgs e)
{
GridDataItem Item = e.Item as GridDataItem;
string s = Item["ServiceName"].Text;
but s again is " "
maybe it happens because I bind my grid via NeedDataSource event
0
Hi Anatoliy,
Most probably you have a control in this cell. When a TableCell Controls collection is not empty the cell Text will be empty.
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Most probably you have a control in this cell. When a TableCell Controls collection is not empty the cell Text will be empty.
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shinu
Top achievements
Rank 2
answered on 04 Sep 2008, 06:05 AM
Hi Anatoliy,
Try accessing the text of a GridButtonColumn as shown below.
ASPX:
CS:
Thanks
Shinu.
Try accessing the text of a GridButtonColumn as shown below.
ASPX:
<telerik:GridButtonColumn DataTextField="ProductName" ButtonType="linkButton" UniqueName="BtnCol"></telerik:GridButtonColumn> |
CS:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
{ |
GridDataItem item = (GridDataItem)e.Item; |
LinkButton lnkbtn = (LinkButton)item["BtnCol"].Controls[0]; |
string strtxt = lnkbtn.Text; |
} |
Thanks
Shinu.