Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Refresh DataSource of DataGridView Inside ToolStripDropDown
 

Refresh DataSource of DataGridView Inside ToolStripDropDown

Hai,

I had added a panel and inside the panel one DataGridview and i added this panel to a toolstripdropdown with the help of toolstripcontrol host.

while clicking on a desired button Gridview inside the toolstripdropdown will get populated. Once it get populated. data is not refreshing of the gridview.

What steps are required to refresh datasource of controls inside the toolstripdropdown control.

Thanks
Raj
Raj - WebDev Raj  Friday, September 18, 2009 12:01 PM

Hi,

You need to expose the datasource property of the datagridview to your custom toolstripControlHost. For example,

// Expose the MonthCalendar.FirstDayOfWeek as a property.

public Day FirstDayOfWeek

{

get

{

return MonthCalendarControl.FirstDayOfWeek;

}

set { value = MonthCalendarControl.FirstDayOfWeek; }

}

Please refer to the following article to get more information.

How to: Wrap a Windows Forms Control with ToolStripControlHost

http://msdn.microsoft.com/en-us/library/9k5etstz.aspx

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Thursday, September 24, 2009 1:54 PM

You can use google to search for other answers

Custom Search

More Threads

• another haschanges question
• How to detect DataGridView's "cancel edit" at the bound datatable level?
• Using an Access database hosted @ IIS
• Directory Polling with Windows Service
• Pop up calender
• DataGridView RowValidating IndexOutOfRangeException
• Textbox
• Datagrid bug?: VerticalSbar don't appear if i load a binding source with a thread at runtime...
• How to get a DataGridViewTextBoxCell to act like multiline textbox without wordwrap?
• DataGridView - editing a column formatted to display the time part of a datetime field.