Accessing .Text inside RadAutoCompleteColumn

3 posts, 0 answers
  1. Massimiliano
    Massimiliano avatar
    184 posts
    Member since:
    Oct 2012

    Posted 28 Dec 2013 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Massimiliano
    Massimiliano avatar
    184 posts
    Member since:
    Oct 2012

    Posted 31 Dec 2013 Link to this post

    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!
Back to Top