GridView Resposive Design

10 posts, 2 answers
  1. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 28 Sep Link to this post

    Hello Admins,

    I want to develop a Responsive DataGrid Record insertion.

    Like When I have to add Data from List<Objects>.

    • I want to Show RowByRow insertion.
    • How can i show waiter control while loading the data From the List.

    What will be Best Solution can be applied in both scenarios.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3431 posts

    Posted 01 Oct Link to this post

    Hello, Kashif,    

    If you need to add row by row in RadGridView and this behavior to be noticeable for the end user, I would suggest you to use a timer. Please refer to the below code snippet which result is illustrated in the attached gif file:

            BindingList<Item> items = new BindingList<Item>();
    
            public RadForm1()
            {
                InitializeComponent();
                this.radGridView1.DataSource = items;
                this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                items.Add(new Item(items.Count, "Item" + items.Count));
            }
    
            public class Item
            {
                public int Id { get; set; }
    
                public string Name { get; set; }
    
                public Item(int id, string name)
                {
                    this.Id = id;
                    this.Name = name;
                }
            }
    
            private void radButton1_Click(object sender, EventArgs e)
            {
                if (!this.timer1.Enabled)
                {
                    this.timer1.Start();
                }
                else
                {
                    this.timer1.Stop();
                }
            }

    As to the waiting indicator, you can use RadWaitingBar which allows you to associate it to any control indicating its load time. The following help article demonstrates a sample approach: https://docs.telerik.com/devtools/winforms/controls/track-and-status-controls/waitingbar/associated-control

    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.
  3. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 01 Oct in reply to Dess | Tech Support Engineer, Sr. Link to this post

    thank you very much. Your example help me a lot.

    Can u provide code used in WaitingIndicator.gif.

     

    thank you

  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3431 posts

    Posted 02 Oct Link to this post

    Hello, Kashif,    

    I have attached my sample project for your reference.

    I hope it would be helpful.

    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.
  5. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 02 Oct in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you Very Much.
  6. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 02 Oct in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Using Associated Control with ONE control is working fine.

    Can we Use associated control property for the whole form, including other controls(like buttons, textboxes etc) on the form.

    Or there will any other method for doing this.

  7. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3431 posts

    Posted 03 Oct Link to this post

    Hello, Kashif,    

    I would suggest you to use a RadPanel as an associated control for the waiting bar. Thus, you can place different controls in the panel and the waiting indication will be shown over all the controls that are hosted in the panel.

    I hope this information helps.

     

    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.
  8. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 03 Oct in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you for the suggestion.

  9. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 17 Oct in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Using waiting bar in timer control is working perfectly.

    Now an other requirement.

    I'm Assigning DataTable to GridView Data Source Property.

    How to show progress/WaitingBar while form is Fetching the Data in the Data table and assigning it to Gridview.DataSource

  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3431 posts

    Posted 22 Oct Link to this post

    Hello, Kashif,      

    For long-lasting operations like extracting data from the database for example, it is suitable to use a BackgroundWorker. Thus, the main UI thread won't be busy with this operation. 

    I would recommend you to have a look at the following help article which demonstrates how to show a waiting bar while a background operation is being executed: https://docs.telerik.com/devtools/winforms/controls/track-and-status-controls/waitingbar/using-waitingbar-with-a-background-worker

    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.
Back to Top