PageViewElement IsSelected

2 posts, 0 answers
  1. Ebrahim
    Ebrahim avatar
    4 posts
    Member since:
    Nov 2011

    Posted 22 Dec 2011 Link to this post

    Hi,

    I have the list of data on grid view with template fields.
    I want to select the child rows if count is not equal to 0.
    Whenever i populate the data, those child rows with count is 0 will be Hidden and IsSelected = false.
    And those child rows with count is not 0 will be Visible and IsSelected = true.
    My problem is the first child row to select is selected forever and unable to click.

    private void raddgvHistory_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
          GridDetailViewCellElement cell = e.CellElement as GridDetailViewCellElement;
          if (cell != null)
          {
            if (cell.PageViewElement != null)
            {
              bool IsSelected = false;
     
              for (int iRow = 0; iRow < cell.PageViewElement.Items.Count; iRow++)
              {
                GridViewInfo viewInfo = cell.PageViewElement.Items[iRow].Tag as GridViewInfo;
                if (viewInfo.ChildRows.Count == 0)
                {
                  cell.PageViewElement.Items[iRow].IsSelected = false;
                  cell.PageViewElement.Items[iRow].Visibility = ElementVisibility.Hidden;
                }
                else
                {
                  if (!IsSelected)
                    IsSelected = cell.PageViewElement.Items[iRow].IsSelected = true;
     
                  cell.PageViewElement.Items[iRow].Visibility = ElementVisibility.Visible;
                }
              }
            }
          }
     
        }

    Correct me if there are some problem with my code.
    Currently using Q2
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 23 Dec 2011 Link to this post

    Hi Ebrahim,

    I tested the described scenario and I was not able to reproduce an issue, as far as I am able to understand it according from your description. Could you please send me your project and the exact steps to reproduce the issue? This will help me to understand it and to provide you with the best possible solution. Thank you for your understanding.

    I am looking forward to your reply.
     
    All the best,
    Jack
    the Telerik team

    Q3’11
    of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top