Is possible show custom popup window in GridViewBrowseColumn ?

12 posts, 1 answers
  1. Jeongmin
    Jeongmin avatar
    7 posts
    Member since:
    Feb 2013

    Posted 13 Aug 2013 Link to this post

    Is possible show custom popup window in GridViewBrowseColumn ?
  2. Answer
    George
    Admin
    George avatar
    500 posts

    Posted 16 Aug 2013 Link to this post

    Hello Jeongmin,

    Thank you for contacting us.

    You can show a custom popup by creating your own GridBrowseEditor. Then you can customize the behavior when the button is in the editor is clicked. A sample implementation of the editor looks like this:
    public class MyBrowseEditor : GridBrowseEditor
    {
        protected override RadElement CreateEditorElement()
        {
            return new MyRadBrowseEditorElement();
        }
    }
     
    public class MyRadBrowseEditorElement : GridBrowseEditorElement
    {
        protected override void InitializeDialog()
        {
            return;
            //base.InitializeDialog();
        }
     
        protected override void OnBrowseButtonClick(EventArgs e)
        {
           return;
           //base.OnBrowseButtonClick(e);
        }
    }

    And the usage:
    void grid_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        bool isGridBrowseEditor = e.EditorType == typeof(GridBrowseEditor);
        if (isGridBrowseEditor)
        {
            e.EditorType = typeof(MyBrowseEditor);
            e.Editor = new MyBrowseEditor();
        }
    }

    You can do whatever suits your needs best in the InitializeDialog and OnBrowseButtonClick methods.

    Hope this helps, if you have any other questions or comments, please let me know.
     
    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Mahsan
    Mahsan avatar
    9 posts
    Member since:
    Dec 2013

    Posted 29 Dec 2013 Link to this post

    Hello George
    I had the same question like Jeongmin and your reply was work for me too, but I have 3  "GridViewBrowseColumn" in my grid that for 2 of them I want
    to pop upa custom windows(which 2 custom windows are different) and for the third one I dont want to make any changes .please help me to make a
    custom  GridViewBrowseColumn  .In addition I have a lot of grid like this in different forms which GridViewBrowseColumns need to pop up different forms

    thank you
     
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3759 posts

    Posted 30 Dec 2013 Link to this post

    Hello Mahsan,

    Thank you for contacting Telerik Support.

    It is necessary to determine which custom pop up should be displayed according to the current GridViewBrowseColumn. Here is a sample code snippet, demonstrating how to show three different pop ups, depending on the currently editing cell's column: 
    public Form1()
    {
        InitializeComponent();
     
        GridViewBrowseColumn column1 = new GridViewBrowseColumn("First Browse Column");
        this.radGridView1.Columns.Add(column1);
     
        GridViewBrowseColumn column2 = new GridViewBrowseColumn("Second Browse Column");
        this.radGridView1.Columns.Add(column2);
     
        GridViewBrowseColumn column3 = new GridViewBrowseColumn("Third Browse Column");
        this.radGridView1.Columns.Add(column3);
     
        this.radGridView1.EditorRequired += radGridView1_EditorRequired;
    }
     
    private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        GridViewEditManager editManager = sender as GridViewEditManager;
        bool isGridBrowseEditor = e.EditorType == typeof(GridBrowseEditor);
        if (isGridBrowseEditor)
        {
            e.Editor = new MyBrowseEditor(editManager.GridViewElement.CurrentColumn.Name);
        }
    }
     
    public class MyBrowseEditor : GridBrowseEditor
    {
        private string editorColumnName;
     
        public MyBrowseEditor(string columnName) : base()
        {
            this.editorColumnName = columnName;
        }
     
        protected override RadElement CreateEditorElement()
        {
            return new MyRadBrowseEditorElement(editorColumnName);
        }
    }
     
    public class MyRadBrowseEditorElement : GridBrowseEditorElement
    {
        private string editorElementColumnName;
     
        public MyRadBrowseEditorElement(string editorColumnName) : base()
        {
            this.editorElementColumnName = editorColumnName;
        }
     
        protected override void OnBrowseButtonClick(EventArgs e)
        {
            //base.OnBrowseButtonClick(e);
            if (editorElementColumnName == "First Browse Column")
            {
                new FirstForm().Show();
            }
            else if (editorElementColumnName == "Second Browse Column")
            {
                new SecondForm().Show();
            }
            else
            {
                new ThirdForm().Show();
            }
        }
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Mahsan
    Mahsan avatar
    9 posts
    Member since:
    Dec 2013

    Posted 07 Jan 2014 Link to this post

    Hello Desislava Thank you for the reply, I do it and It works.but know I have another question, I have a grid in which has a column for part code, the user must be able to select partcode so I decided to use GridViewMultiComboBoxColumn the MultiComboBox show 4 column,PartId,PartCode,PartName,UnitName and Descr (Part Id Is Invisible),by default user can filter the MultiComboBox by PartCode ,but the user needed to be able to filter it by PartName or UnitName or Descr ,so  by  using EditorControl_CustomFiltering () and
    getting the CurrenColumn of the RadMultiColumnComboBoxElement I set the filter maually ,so when the user click on each column of the MultiComboBox he can change the filter.
    This solution works for me but I want to have stronger and more flexible filtering for GridViewMultiComboBoxColumn as the result of this I 
    want to use GridViewBrowseColumn and open a Searchform OnBrowseButtonClick() which in Searchform is a grid and the grid shows parts information (PartId,PartCode,PartName,UnitName and Descr (Part Id Is Invisible))  so in this form user can make complex and nested filtering and at last select a partcode
    but I dont know how return the information of selected partcode to the main form and I want to  bound the GridViewBrowseColumn 
    with part 
     .please help me to solve this problem.

    Best Regard,
     Mahsan






  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3759 posts

    Posted 09 Jan 2014 Link to this post

    Hello Mahsan,

    Thank you for writing back.

    Currently you can filter in RadMultiColumnComboBox only by setting the AutoFilter property. You can find more information in the "Multicolumncombox filtering in gridview" forum thread how to implement filtering in GridViewMultiComboBoxColumn. We have already a Feature Request, logged in our Public Issue Tracking System - PITS about this topic. You can track its progress, subscribe for status changes and add your vote/comment to it on the referred link.

    As to the question about how to get the filtered data collection and to pass it as parameter to the search form, you may have a look at our Rows vs ChildRows help article, which may guide you to achieve the desired behavior.

    Please do not hesitate to contact us if you have any additional questions.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. reyhane
    reyhane avatar
    7 posts
    Member since:
    Oct 2019

    Posted 15 Dec 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello 

    What is GridBrowseEditorElement namespace? 

  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3759 posts

    Posted 16 Dec 2019 Link to this post

    Hello, Reyhane,    

    Since R2 2018 GridBrowseEditor uses RadBrowseEditorElement because the GridBrowseEditorElement was obsolete since Q1 2016. Feel free to use the RadBrowseEditorElement instead.

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

     

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  9. reyhane
    reyhane avatar
    7 posts
    Member since:
    Oct 2019

    Posted 16 Dec 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank for your answer

    How to access to my radgridview?

     

    protected override void OnBrowseButtonClick(EventArgs e)
              {
                  if (editorElementColumnName == "GetDate" )
                  {
     
                      GetValueFrm getValue = new GetValueFrm(Onvan, 3, false);
                      getValue.ShowDialog();
     
                      int currentcol = radGridView1.CurrentColumn.Index;
                      int currentrow = radGridView1.CurrentRow.Index;
                      if (!GetValueFrm.Cancel)
                      {
                          radGridView1.CurrentRow.Cells["GetDate"].Value = getValue.SearchValue;
                          radGridView1.CurrentRow = radGridView1.Rows[currentrow];
                          radGridView1.CurrentColumn = radGridView1.Columns[currentcol + 1];
                          radGridView1.CurrentCell.IsSelected = true;
                      }
                  }
               
              }

                       

  10. reyhane
    reyhane avatar
    7 posts
    Member since:
    Oct 2019

    Posted 16 Dec 2019 in reply to reyhane Link to this post

    I found this question's answer :)
  11. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3759 posts

    Posted 16 Dec 2019 Link to this post

    Hello, Reyhane,     

    I am glad that you have found a solution for your case. However, I would like to share that the easiest way to access the RadGridView control in the OnBrowseButtonClick method of your custom RadBrowseEditorElement is by accessing the Parent which is actually the GridBrowseCellElement which GridControl property refers to the RadGridView itself:
                    GridBrowseCellElement cell= this.Parent as GridBrowseCellElement;
                    RadGridView grid= cell.GridControl; 
    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  12. reyhane
    reyhane avatar
    7 posts
    Member since:
    Oct 2019

    Posted 16 Dec 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    very good! Thank you
Back to Top