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

how to get values by selecting a row?

10 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 12 Nov 2008, 05:02 PM
i have been trying for how to get values from grid by selecting a row. But i am unable to do it, please help me....
I want to get all values in a selected row with those column values as well which arent been shown on grid..
Actually i have made a query to select few things from database table and shown it using radgrid. but how to extract all values when user click on it or clicks on a link given for it on each row....but remember those values too which arent been shown on grid....plz help me!

10 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Nov 2008, 05:37 PM
Hello Saadi,

I created a sample website illustrating the functionality you requested.
Please let us know if you need further assistance.

Greetings,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Saad
Top achievements
Rank 1
answered on 13 Nov 2008, 10:07 AM
But where have you given the link of that sample website?
There isnt any link for sample website.....
Anyway thank you very much in advance. Now just do reply me the link of it...please!
0
Daniel
Telerik team
answered on 13 Nov 2008, 12:25 PM
Hello Saadi,

I reattached the example. Please excuse me for the inconvenience.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Saad
Top achievements
Rank 1
answered on 14 Nov 2008, 03:14 PM
Thanks alot for guiding me....
I just need a little more guidance now. If i want to have link in each row and do the same on clicking it, then what should i do for it?
0
Daniel
Telerik team
answered on 14 Nov 2008, 03:48 PM
Hello Saadi,

I modified the example to fit your requirements. Please test it and let me know whether this helps.

Greetings,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Saad
Top achievements
Rank 1
answered on 15 Nov 2008, 12:30 PM
And if i want to show a radwindow when ever link on each row of radGrid is clicked, then what should i do for it?
I have done exactly the same as you`ve told me by using:

 

protected

void NoteBook_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

    if(e.CommandName ==

"GetAllItems")
    {
    ..........
    }
}

So please tell this more....and THANK YOU very very much for this much support

 

0
Saad
Top achievements
Rank 1
answered on 17 Nov 2008, 05:21 AM
Now I want to place a text box whenever a user clicks on a row with link. I want that specific row to get hidden and place text box with 'ok' and 'cancel' buttons in place of that...If user clicks 'ok' or 'cancel', it do appropriate tasks and place that row again and hide text box and buttons....please guide me in it. Plllllzzzzzzzzzzzzzzzz!!!!!!

By the way thanks alott for so much guidance till now.....Thank you!
0
Princy
Top achievements
Rank 2
answered on 17 Nov 2008, 07:18 AM
Hello Saadi,

A suggestion would be to use an EditFormTemplate with the required controls in it. On clicking the link Button, you can put the row in EditMode and hide that particular row, so that only the FormTemplate is displayed. Check out the code below for the same:
aspx:
<Columns>  
    <telerik:GridEditCommandColumn EditText="Viewform" UniqueName="Col">                 
    </telerik:GridEditCommandColumn>  
</Columns>  
<EditFormSettings EditFormType="Template"
    <FormTemplate> 
              <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> 
              <asp:Button ID="Button5" runat="server" Text="OK" /> 
              <asp:Button ID="Button6" runat="server" Text="Cancel" CommandName="Cancel" /> 
    </FormTemplate>                    
</EditFormSettings> 

cs:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    {       
        if (e.Item is GridEditableItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted) 
        { 
            GridEditFormItem editItem = (GridEditFormItem)e.Item; 
            editItem.ParentItem.Visible = false;           
           
        } 
    } 
         

Thanks
Princy.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 17 Nov 2008, 07:52 AM
Hi Saadi,

You can also refer to the following link to open a window on the click of a link button in the grid.
Window Editing

Thanks
Shinu.
0
Saad
Top achievements
Rank 1
answered on 17 Nov 2008, 12:54 PM
Ok thanks alottt...
Now i have put in a radTextBox (multilined and with button) instead of using a simple text box and to buttons....I need to know that whether can i place one more button with radTextBox? And how to do something on each OnButtonClick ? I need to put that text entered in text into the database.....
Tags
Grid
Asked by
Saad
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Saad
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or