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

[Solved] Populating text in textbox while click on row of RadGrid

2 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lim
Top achievements
Rank 1
Lim asked on 25 Aug 2009, 02:29 AM
Hi all, 

I am trying to populate some text in the textbox while i click on the row of the RadGrid.
The text that I am trying to populate are from the server side process result.
I failed to populate those text even though i have set the autopostback event to both control.
Am I missing anything? Please advise.

Thanks in advance.

Regards,
Lim

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Aug 2009, 04:06 AM
Hi Lim,

I am not sure whether the TextBox is inside the Grid or not. In order to populate the textbox set the EnablePostBackOnRowClick property to true and in the ItemCommand event populate the textbox.

ASPX:
 
<
ClientSettings EnablePostBackOnRowClick="true" > 

CS:
 
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "RowClick"
        {  
            GridDataItem currentRow=(GridDataItem)e.Item; 
              TextBox1.Text=currentRow["columnUniqueName"].Text; 
        } 
    } 


Regards
Shinu

0
Lim
Top achievements
Rank 1
answered on 25 Aug 2009, 05:09 AM
Thanks for your fast reply, Shinu.

The textbox is not inside the grid.
And I have tried your suggestion, it failed. 
I realized one thing is that the RadGrid1_ItemCommand event has processed and changed the text of the textbox, but the processed text juz don't show on the textbox when all the processes at server side are done. Any idea??

 

Regards,
Lim
Tags
Grid
Asked by
Lim
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Lim
Top achievements
Rank 1
Share this question
or