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

GridView command button Clicking the Filter button in the disappears

6 Answers 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 18 Dec 2014, 03:48 PM
 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;
                      }
                  }
              }
           
        }

6 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 19 Dec 2014, 04:47 PM
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.

 
0
Ali
Top achievements
Rank 1
answered on 22 Dec 2014, 07:08 AM
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 .
0
Accepted
Stefan
Telerik team
answered on 22 Dec 2014, 12:36 PM
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.

 
0
Ali
Top achievements
Rank 1
answered on 22 Dec 2014, 02:42 PM
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
0
Stefan
Telerik team
answered on 24 Dec 2014, 12:51 PM
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.

 
0
Ali
Top achievements
Rank 1
answered on 24 Dec 2014, 02:21 PM
Thank you so problem solved
Tags
GridView
Asked by
Ali
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ali
Top achievements
Rank 1
Share this question
or