Caching + Getting Selected cell value using code behind

6 posts, 0 answers
  1. Aarsh
    Aarsh avatar
    192 posts
    Member since:
    Jun 2012

    Posted 12 Nov 2012 Link to this post

    I've had posted my code snip in another forum : http://www.telerik.com/community/forums/aspnet-ajax/rotator/q3-2012-adds-border.aspx#2369096

    1. And I am wanting to figure out a way so that I can cache the result set being returned from the database, as I would be doing just the read operations & the data is not going to be updated per my application scenario.
    2. I also want to be able to retrieve the value of the first column of the selected row (cell selection should be disabled) in the code-behind. I looked at the help topics but could not find something that depicts same or similar to my query.

    Thanks for your help,
    -Aarsh

  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 15 Nov 2012 Link to this post

    Hi Aarsh,

    Regarding your first questions: You could achieve your scenario by saving the returned data in a Session or ViewState variable as shown in the example below.
    private DataTable Data
    {
        get
        {
            object obj = Session["Data"];
            if (obj != null)
            {
                return (DataTable)obj;
            }
            // Instead of static creation of data you could
            // retrieve it once from the database.
            DataTable table = new DataTable();
            table.Columns.Add("Date");
            table.Columns.Add("Score");
            table.Rows.Add(DateTime.Now, 1);
            table.Rows.Add(DateTime.Now, 1);
            return table;
        }
    }

    Regarding your second questions: The first cell could be selected as shown below. Note that the firstColumnIndex could very and you should investigate and check which is the first column index.
    int firstColumnIndex = 1;
    TableCell cell = RadGrid1.SelectedItems[0].Cells[firstColumnIndex];

    Kind regards,
    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aarsh
    Aarsh avatar
    192 posts
    Member since:
    Jun 2012

    Posted 15 Nov 2012 Link to this post

    Thank you so much, Antonio ! Actually it was an urgent thing and hence I ended up using a default asp:GridView. Here are the details 
    (http://forums.asp.net/post/5210077.aspx)

    -Aarsh
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 20 Nov 2012 Link to this post

    Hello Aarash,

    Thank you for updating us on this thread.

    Do not hessite to contact us back in case any issues with the RadGrid control appear in feature. We will be glad to help you in case you roll back to the RadGrid control which I believe is a very powerful component with a  lot of great functionalities.

    Greetings,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Aarsh
    Aarsh avatar
    192 posts
    Member since:
    Jun 2012

    Posted 11 Dec 2012 Link to this post

    Thank you so much Maria, I do have a radGrid question @ http://www.telerik.com/community/forums/aspnet-ajax/grid/nested-grid-demo-a-question.aspx#2410165.

    [ AARSH :=) ]
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 14 Dec 2012 Link to this post

    Hi Irish,

    Please review the answer provided in the forum post you mentioned and verify if it helps.
    I would suggest you to continue the support communication in the newly created forum thread for better tracking the issue.

    All the best,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017