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

Accessing .Text inside RadAutoCompleteColumn

2 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Massimiliano
Top achievements
Rank 1
Massimiliano asked on 28 Dec 2013, 01:05 PM
For some reason trying to use 

RadGrid1.MasterTableView.Items(e.Item.ItemIndex)("CoulmName").Text

inside RadGrid ItemCommand event always gives back " " if the column referenced is RadAutoCompleteColumn.
All other column types (including GridDateTimeColumn or GridBoundColumn) retrieve the correct value.

Any hint? Is there some control inside? Looking at the HTML it wouldn't seem so... not even a span.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Dec 2013, 09:05 AM
Hi Massimiliano,

Please have a look into the following code snippet to access the Text inside the RadAutoCompleteColumn on OnItemCommand event.

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
        Literal litrlContrl = (Literal)dataItem["UniqueName"].Controls[0];
        string value = litrlContrl.Text;
    }
}

Hope this will helps you.
Thanks,
Shinu.
0
Massimiliano
Top achievements
Rank 1
answered on 31 Dec 2013, 10:20 AM
Thank you Shinu.. I imagined there was a control but since there were no tags in the HTML output I didn't think to to obvious Literal control.
Thanks again!
Tags
Grid
Asked by
Massimiliano
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Massimiliano
Top achievements
Rank 1
Share this question
or