6 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 23 Dec 2013, 01:28 PM
Hi Erin,
Below is the code I tried to get the selected row index on a button click, please try and let me know if any concern.
C#:
Thanks,
Princy
Below is the code I tried to get the selected row index on a button click, please try and let me know if any concern.
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
foreach
(GridDataItem ditem
in
RadGrid1.SelectedItems)
{
int
index = ditem.ItemIndex;
// Selected row index
}
}
Thanks,
Princy
0

Ryan
Top achievements
Rank 1
answered on 26 Dec 2013, 03:02 PM
Hi princy.
How can I change the row color here?
How can I change the row color here?
0

Ryan
Top achievements
Rank 1
answered on 26 Dec 2013, 03:05 PM
I need to change the color of an unselected row.. I didn't have selection property set for the grid view
0

Shinu
Top achievements
Rank 2
answered on 26 Dec 2013, 03:13 PM
Hi Ryan,
I guess you want to set the back-color of rows, below is a sample code snippet that i tried to set back-color on button click.
C#:
Thanks,
Shinu
I guess you want to set the back-color of rows, below is a sample code snippet that i tried to set back-color on button click.
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
RadGrid1.MasterTableView.Items)
{
item[
"ColumnUniqueName"
].BackColor = Color.Red;
}
}
Thanks,
Shinu
0

Ryan
Top achievements
Rank 1
answered on 27 Dec 2013, 08:20 AM
Hi,
Thanks for the response.. is it possible with by setting the color in css .
Thanks for the response.. is it possible with by setting the color in css .
0

Shinu
Top achievements
Rank 2
answered on 27 Dec 2013, 08:31 AM
Hi Ryan,
Please try the following code snippet:
C#:
CSS:
Thanks,
Shinu
Please try the following code snippet:
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
RadGrid1.MasterTableView.Items)
{
item[
"OrderID"
].CssClass =
"color"
;
}
}
CSS:
<style type=
"text/css"
>
.color
{
background-color
: Red;
}
</style>
Thanks,
Shinu