Hi,
There is 2 links appear by default when we allow for In Mode editing works in radgrid, "Add new record" and "Refresh" link. "Add new record" will locate at left hand side of the grid while "Refresh" link will locate at right hand side of the grid.
May i know is it possible to move the "Refresh" link to left hand side too?
And how to do that?
Please advice.
Thanks.
Regards,
Soo
                                There is 2 links appear by default when we allow for In Mode editing works in radgrid, "Add new record" and "Refresh" link. "Add new record" will locate at left hand side of the grid while "Refresh" link will locate at right hand side of the grid.
May i know is it possible to move the "Refresh" link to left hand side too?
And how to do that?
Please advice.
Thanks.
Regards,
Soo
7 Answers, 1 is accepted
0
                                Hi soo,
You can customize the Grid CommantItem as per your requirements. Please, take a look at this demo where a complex CommandItemTemplate is implemented. You will find more useful info about the CommandItem in the docs here.
Best wishes,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
                                        You can customize the Grid CommantItem as per your requirements. Please, take a look at this demo where a complex CommandItemTemplate is implemented. You will find more useful info about the CommandItem in the docs here.
Best wishes,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
                                
                                                    Shinu
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 04 Jun 2008, 12:16 PM
                                            
                                        Hi Soo,
You can also try the following code snippet.
CS:
    
Thanks
Shinu.
                                        You can also try the following code snippet.
CS:
| protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) | 
| { | 
| if (e.Item is GridCommandItem) | 
| { | 
| GridCommandItem cmditm = (GridCommandItem)e.Item; | 
| LinkButton lnkbtn = (LinkButton)cmditm.FindControl("RebindGridButton"); | 
| lnkbtn.Visible = false; | 
| LinkButton lnkbtn1 = new LinkButton(); | 
| lnkbtn1.ID = "LinkButton1"; | 
| lnkbtn1.Text = "Refresh"; | 
| TableCell cell = new TableCell(); | 
| cell.ID = "Cell1"; | 
| cell.Controls.Add(lnkbtn1); | 
| cmditm.Controls.Add(cell); | 
| } | 
| } | 
Thanks
Shinu.
0
                                
                                                    soo
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 12 Jun 2008, 01:50 PM
                                            
                                        Hi,
May i know what is id for Refresh and Add New Record? It will show this 2 links by automatically when i allow editing in mode.
I'm not successfull get the ID for Refresh and Add new record.
Please advice.
Thanks.
Regards,
Soo
                                        May i know what is id for Refresh and Add New Record? It will show this 2 links by automatically when i allow editing in mode.
I'm not successfull get the ID for Refresh and Add new record.
Please advice.
Thanks.
Regards,
Soo
0
                                Hi soo,
The ids of the default [Add new record]/[Refresh] buttons are listed in the table of this documentation topic:
http://www.telerik.com/help/aspnet-ajax/grdlocalizingcommanditem.html
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
                                        The ids of the default [Add new record]/[Refresh] buttons are listed in the table of this documentation topic:
http://www.telerik.com/help/aspnet-ajax/grdlocalizingcommanditem.html
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
                                
                                                    soo
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 12 Jun 2008, 03:02 PM
                                            
                                        Hi,
My code as below : -
                                        My code as below : -
If
TypeOf e.Item Is GridCommandItem Then
Dim cmditm As GridCommandItem = DirectCast(e.Item, GridCommandItem)
Dim lnkbtn As LinkButton = DirectCast(cmditm.FindControl("InitInsertButton"), LinkButton)
Dim lnkbtn1 As LinkButton = DirectCast(cmditm.FindControl("RebindGridButton"), LinkButton)
End If
I'm not able to assign the lnkbtn.visible = false, as no control was found.
May i know what wrong with my code.  Is it correct to do that? 
Please advice.
Thanks.
Regards,
Soo
0
                                
                                                    Shinu
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 13 Jun 2008, 06:51 AM
                                            
                                        Hi Soo,
Give a try with the following code snippet and see whether it is working.
CS:
    
Thanks
Shinu.
                                        Give a try with the following code snippet and see whether it is working.
CS:
| protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) | 
| { | 
| if (e.Item is GridCommandItem) | 
| { | 
| GridCommandItem cmditm = (GridCommandItem)e.Item; | 
| LinkButton lnkbtn1 = (LinkButton)cmditm.Controls[0].Controls[0].Controls[0].Controls[0].Controls[1]; | 
| lnkbtn1.Visible = false; | 
| LinkButton lnkbtn2 = (LinkButton)cmditm.Controls[0].Controls[0].Controls[0].Controls[1].Controls[1]; | 
| lnkbtn2.Visible = false; | 
| } | 
| } | 
Thanks
Shinu.
0
                                Hello Soo,
These are IDs for the CommandItem buttons as mentioned before:
'Add New Record' button:
InitInsertButton - text
AddNewRecordButton - image
'Refresh' button:
RebindGridButton - text
RefreshButton - image
In order to hide the Refresh button (for instance), consider using the following approach:
    
Furthermore, you may find this link helpful: Hide AddNew
Greetings,
Daniel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
                                        These are IDs for the CommandItem buttons as mentioned before:
'Add New Record' button:
InitInsertButton - text
AddNewRecordButton - image
'Refresh' button:
RebindGridButton - text
RefreshButton - image
In order to hide the Refresh button (for instance), consider using the following approach:
| If TypeOf e.Item Is GridCommandItem Then | 
| Dim gci As GridCommandItem = TryCast(e.Item, GridCommandItem) | 
| gci.FindControl("RefreshButton").Visible = False | 
| gci.FindControl("RebindGridButton").Visible = False | 
| End If | 
Furthermore, you may find this link helpful: Hide AddNew
Greetings,
Daniel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center