I work for a homeless shelter and have created a Visual Basic application using Visual Studio .NET 2003. I have two questions about the DataGrid object I'm using in my application.
1. When the DataGrid is initially presented to the user (on form load) the grid is empty. The form load (frmMain_Load) has the following code:
grdDailyAttendance.CaptionText = "Daily Attendance Records"
grdDailyAttendance.DataSource = DataSet11
grdDailyAttendance.DataMember = "tblDailyAttendance"
grdDailyAttendance.AllowDrop = False
grdDailyAttendance.AllowNavigation = False
grdDailyAttendance.AllowSorting = False
The user clicks a button to select the Daily Attendance records for a particular day. The number of records loaded into the DataGrid for the selected day is larger than the display area of the DataGrid. The user is unable to scroll down the DataGrid to view the records below the display area (The vertical scroll bar has nothing to click and drag to scroll down). How can I add vertical scrolling to the DataGrid?
2. How do I keep the DataGrid from sorting the data when the user clicks the column headers? I thought the AllowSorting method would not allow the DataGrid to sort the data, however the grid sorts the data when the column header is clicked.
Does anyone have any ideas for these two issues? Thank you in advance for your time and consideration.
Ed
1. When the DataGrid is initially presented to the user (on form load) the grid is empty. The form load (frmMain_Load) has the following code:
grdDailyAttendance.CaptionText = "Daily Attendance Records"
grdDailyAttendance.DataSource = DataSet11
grdDailyAttendance.DataMember = "tblDailyAttendance"
grdDailyAttendance.AllowDrop = False
grdDailyAttendance.AllowNavigation = False
grdDailyAttendance.AllowSorting = False
The user clicks a button to select the Daily Attendance records for a particular day. The number of records loaded into the DataGrid for the selected day is larger than the display area of the DataGrid. The user is unable to scroll down the DataGrid to view the records below the display area (The vertical scroll bar has nothing to click and drag to scroll down). How can I add vertical scrolling to the DataGrid?
2. How do I keep the DataGrid from sorting the data when the user clicks the column headers? I thought the AllowSorting method would not allow the DataGrid to sort the data, however the grid sorts the data when the column header is clicked.
Does anyone have any ideas for these two issues? Thank you in advance for your time and consideration.
Ed