GridView command button Clicking the Filter button in the disappears

7 posts, 1 answers
  1. Ali
    Ali avatar
    4 posts
    Member since:
    Dec 2014

    Posted 18 Dec 2014 Link to this post

     Hi
    My problem GridView CommandButton feature is working but filter click buttons to disappear

    Thx.

    private void gvw_AcilanDersler_CellFormatting(object sender, CellFormattingEventArgs e)
            {
               if (e.CellElement.ColumnInfo is GridViewCommandColumn)
                  {
                      if (e.CellElement.RowInfo.Cells["AcilanDersNotDurumKod"].Value != null)
                      {
                          RadButtonElement button = (RadButtonElement)e.CellElement.Children[0];
                          string title = e.CellElement.RowInfo.Cells["AcilanDersNotDurumKod"].Value.ToString();
                          if (title == "SON")
                          {
                              button.Enabled = true;
                              ((GridCommandCellElement)e.CellElement).CommandButton.Text = Strings.NotGirisineIzinVer;
                          }
                          else if (title == "IZI")
                          {
                              button.Enabled = true;
                              ((GridCommandCellElement)e.CellElement).CommandButton.Text = Strings.NotGirisiIzniniGeriAl;
                          }

                          else
                          {
                           
                              button.Visibility = ElementVisibility.Hidden;
                          }
                      }
                  }
               
            }
  2. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 19 Dec 2014 Link to this post

    Hello Ali,

    Can you please provide a little more information on what is precisely the issue you experience?

    I am looking forward to your reply.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Ali
    Ali avatar
    4 posts
    Member since:
    Dec 2014

    Posted 22 Dec 2014 in reply to Stefan Link to this post

    show GridView button in text form by cells in the colon or command button , but I hide the column disappears when I press the buttons to filter .
  4. Answer
    Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 22 Dec 2014 Link to this post

    Hello Ali,

    I am having difficulties understanding what is your question. Would it be possible capture a video of the undesired behavior. You can use Jing for the purpose. Some images/sketches of the desided UI might also help.

    I am looking forward to your reply.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Ali
    Ali avatar
    4 posts
    Member since:
    Dec 2014

    Posted 22 Dec 2014 in reply to Stefan Link to this post

    I do not understand how you understand the problem, I added two pictures 1 picture I want a normal state, but the filter is going Clicking 2 pictures
  6. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 24 Dec 2014 Link to this post

    Hi Ali,

    If I understand correctly, after filtering your buttons are disappearing. If so, this is most likely caused by the CellFormatting event handler you have, where you need to reset the property settings you introduce. Something like: 
    private void gvw_AcilanDersler_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
            {
                if (e.CellElement.ColumnInfo is GridViewCommandColumn)
                {
                    RadButtonElement button = (RadButtonElement)e.CellElement.Children[0];
     
                    if (e.CellElement.RowInfo.Cells["AcilanDersNotDurumKod"].Value != null)
                    {
                        string title = e.CellElement.RowInfo.Cells["AcilanDersNotDurumKod"].Value.ToString();
                        if (title == "SON")
                        {
                            button.Visibility = ElementVisibility.Visible;
                            ((GridCommandCellElement)e.CellElement).CommandButton.Text = Strings.NotGirisineIzinVer;
                        }
                        else if (title == "IZI")
                        {
                            button.Visibility = ElementVisibility.Visible;
                            ((GridCommandCellElement)e.CellElement).CommandButton.Text = Strings.NotGirisiIzniniGeriAl;
                        }
                        else
                        {
                            button.Visibility = ElementVisibility.Hidden;
                        }
                    }
                    else
                    {
                        button.ResetValue(RadElement.VisibilityProperty, ValueResetFlags.Local);
                    }
                }
            }

    More information and examples are available here: Formatting Cells | UI for WinForms Documentation.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Ali
    Ali avatar
    4 posts
    Member since:
    Dec 2014

    Posted 24 Dec 2014 Link to this post

    Thank you so problem solved
Back to Top