This is a migrated thread and some comments may be shown as answers.

making the gridview row bold based on some conditions

1 Answer 305 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 25 May 2011, 09:53 PM
Hi All,
  I am trying to make the gridview row bold, The first row of my gridview is linkbuttons. when someone clicks on the linkbutton then I want to make the row bold, this works fine in my code, I want to show a pop up message to the user if the user clicks on another link button. the pop up message should say "You are leaving the link (Old Link Button ID) and you are going to (new link button ID) here. Are you Sure? if the user clicks "Yes" in the pop up window then I need to bold the new link button row that the user just clicked otherwise if the user clicks "NO" or cancel then I need to keep the old link button row bolded.

I tried lot of things and put lot of hours in it, but couldn't get forward with this.  Below is my code
This is inside the DataBound event of grid:
 foreach (GridDataItem item in RadGrid_IDPicker.Items)
                {
  
                    if (Convert.ToString(DataBinder.Eval(item.DataItem, "IID")) == lblID.Text)
                    {
                         
                        item.Style.Add(HtmlTextWriterStyle.FontWeight, "Bold");
                       
                    }
if (lblIDTemp.Text != lblID.Text)
{
  
   string radalertscript = "<script language='javascript'>function f(){confirm_select('" + lblIDtemp.ClientID + "'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
  
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", radalertscript);
  
}
        
}

In above code lblIDTemp is the value of the old link button which I stored in a hidden variable and lblID is the new link button value which i stored in another hidden varaible.

Any help will be higly apprecaited. I am trying to solve this problem since morning and don't know how to solve it.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 31 May 2011, 11:27 AM
Hello Anjali,

The provided code looks ok to me and I was not able to isolate obvious reason for the issue you are facing. If it is convenient for you could you please open a regular support ticket and send us sample runnable version of your application. Thus we will be able to debug it locally and advise you further.

All the best,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Anjali
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or