

![]() |
|
|
VB .NET Dim DGCommands As DataGridCommands = New DataGridCommands() DGCommands.UpdateDataSource(tableDataSource, yourDataGrid) C# // Save datagrid data source tableDataSource table DataGridCommands DGCommands = new DataGridCommands(); DGCommands.UpdateDataSource(tableDataSource, yourDataGrid); |
|
By clicking the "Save" button your user will be able to save all updates into DataGrid's datasource data object. |
![]() |
![]() |
The combobox column is not a dropdown list, which appears when a
datagrid cell becomes the current cell. The ASP .NET DataGrid combobox
Column control has the following attractive features: |
VB .NET ' and assign it to the DataGrid1 'Company' column. Dim comboCompany As ComboBoxColumn = DataGrid1.Columns(5) ' Define Name of Interface Page that will be called by clicking on ComboBox button comboCompany.InterfacePageName = "ComboInterfacePage.html" |
' Define width of Interface Page comboCompany.InterfacePageWidth = 290 ' Define height of Interface Page comboCompany.InterfacePageHeight = 400 ' Assign DataSource property for comboCompany object as tblCompanies ' data table where Companyss names are stored. comboCompany.DataSource = tblCompanies ' Specify DisplayMember as "Name" field of tblCompanies table comboCompany.DisplayMember = "Name" ' Specify ValueMember as "PubID" field of tblCompanies table comboCompany.ValueMember = "PubID" ' Identify "Company" column's foreground color comboCompany.ForeColor = Color.DarkMagenta ' Identify "Company" column characters' font and size comboCompany.Font_Name = "Tahoma" comboCompany.Font_Size = FontUnit.Point(8) ' Adjust "Company" column's width comboCompany.Width = Unit.Point(60) C# // Define comboCompany variable as an object of ComboBoxColumn class // and assign it to the DataGrid1 'Company' column. ComboBoxColumn comboCompany = (ComboBoxColumn)DataGrid1.Columns[5]; |
|
// Define Name of Interface Page that will be called by clicking on
ComboBox button comboCompany.InterfacePageName = "ComboInterfacePage.html"; // Define width of Interface Page comboCompany.InterfacePageWidth = 345; // Define height of Interface Page comboCompany.InterfacePageHeight = 400; // Assign DataSource property for comboCompany object as tblCompanies // data table where Companyss names are stored. comboCompany.DataSource = tblCompanies; // Specify DisplayMember as "Name" field of tblCompanies table comboCompany.DisplayMember = "Name"; // Specify ValueMember as "PubID" field of tblCompanies table comboCompany.ValueMember = "PubID"; // Identify "Company" column's foreground color comboCompany.ForeColor = Color.DarkMagenta; // Identify "Company" column characters' font and size comboCompany.Font_Name = "Tahoma"; comboCompany.Font_Size = FontUnit.Point(8); // Adjust "Company" column's width comboCompany.Width = Unit.Point(60); |
![]() ![]() ![]() ![]() ![]() ![]() ![]() </HEAD> <body onload="return windowLoad()">
![]() ![]() ![]() End Sub
C# { ![]() ![]() ![]() } |
![]() |
The TextBoxColumn hosts a TextBox control that allows users to directly edit
text values. |
| ||
VB .NET ' and assign it to the DataGrid1 "City" column. Dim TxtBox As TextBoxColumn = DataGrid1.Columns(2) ' Identify "City" column's foreground color TxtBox.ForeColor = Color.DarkMagenta ' Identify "City" column characters' font and size TxtBox.Font_Name = "Tahoma" TxtBox.Font_Size = FontUnit.Point(8) ' Adjust "City" column's width TxtBox.Width = Unit.Point(60) C# // Define TxtBox variable as an object of TextBox Column class // and assign it to the DataGrid1 "City" column. TextBoxColumn TxtBox = (TextBoxColumn)DataGrid1.Columns[2]; // Identify "City" column's foreground color TxtBox.ForeColor = Color.DarkMagenta; // Identify "City" column characters' font and size TxtBox.Font_Name = "Tahoma"; TxtBox.Font_Size = FontUnit.Point(8); // Adjust "City" column's width TxtBox.Width = Unit.Point(60); |
|
![]() |
Use the ASP DataGrid DropDownColumn to create a single selection drop-down
list control in each cell of DataGrid column. You can control the appearance
of the ASP DataGrid DropDownColumn by setting the BackColor, ForeColor,
BorderColor, BorderStyle, and other properties. The control displays in a
datagrid cell a single value that is selected from a collection by clicking
the button of the control. Your user can enter text in the control if the
string typed in matched an item in the collection to be accepted. |
|
VB .NET ' and assign it to the DataGrid1 'State' column. Dim DropDown As DropDownColumn = DataGrid1.Columns(5) ' Assign DataSource property for DropDown object as tblStates ' data table where statess names are stored. DropDown.DataSource = tblStates ' Specify DisplayMember as "Name" field of tblStates table DropDown.DisplayMember = "Name" ' Specify ValueMember as "State" field of tblStates table DropDown.ValueMember = "State" ' Identify "State" column's foreground color DropDown.ForeColor = Color.DarkMagenta ' Identify "State" column characters' font and size DropDown.Font_Name = "Tahoma" DropDown.Font_Size = FontUnit.Point(8) ' Adjust 'State' column's width DropDown.Width = Unit.Point(60) C# // Define DropDown variable as an object of DropDownColumn class // and assign it to the DataGrid1 'State' column. DropDownColumn DropDown = (DropDownColumn)DataGrid1.Columns[5]; // Assign DataSource property for DropDown object as tblStates // data table where statess names are stored. DropDown.DataSource = tblStates; // Specify DisplayMember as "Name" field of tblStates table DropDown.DisplayMember = "Name"; // Specify ValueMember as "State" field of tblStates table DropDown.ValueMember = "State"; // Identify "State" column's foreground color DropDown.ForeColor = Color.DarkMagenta; // Identify "State" column characters' font and size DropDown.Font_Name = "Tahoma"; DropDown.Font_Size = FontUnit.Point(8); // Adjust 'State' column's width DropDown.Width = Unit.Point(60); |
![]() |
The DatePicker Column is used to allow the user to select a date, and to
display that date in your ASP .NET DataGrid interface. |
|
VB .NET ' and assign it to the DataGrid1 'Date' column. Dim DatePicker As DatePickerColumn = DataGrid1.Columns(5) ' Identify "Date" column's foreground color DatePicker.ForeColor = Color.DarkMagenta ' Identify "Date" column characters' font and size DatePicker.Font_Name = "Tahoma" DatePicker.Font_Size = FontUnit.Point(8) ' Adjust 'Date' column's width DatePicker.Width = Unit.Point(60) ' Define yearGreaterThanPresentYear property. If the inserted year is greater ' than current year plus 20 the control will use "19" as first two digits for year, ' otherwise will use "20" DatePicker.yearGreaterThanPresentYear = 20 C# // Define DatePicker variable as an object of DatePickerColumn class // and assign it to the DataGrid1 'Date' column. DatePickerColumn DatePicker = (DatePickerColumn)DataGrid1.Columns[5]; // Identify "Date" column's foreground color DatePicker.ForeColor = Color.DarkMagenta; // Identify "Date" column characters' font and size DatePicker.Font_Name = "Tahoma"; DatePicker.Font_Size = FontUnit.Point(8); // Adjust 'Date' column's width DatePicker.Width = Unit.Point(60); // Define yearGreaterThanPresentYear property. If the inserted year is greater // than current year plus 20 the control will use "19" as first two digits for year, // otherwise will use "20" DatePicker.yearGreaterThanPresentYear = 20 |
|
|
![]() |
|
VB .NET ' and assign it to the DataGrid1 'YesNo' column. Dim CheckBox As CheckBox Column = DataGrid1.Columns(5) C# // Define CheckBox variable as an object of CheckBox Column class // and assign it to the DataGrid1 'YesNo' column. CheckBox Column CheckBox = (CheckBox Column)DataGrid1.Columns[5]; |
![]() |
|
|
VB .NET ' and assign it to the DataGrid1 'Time' column. Dim DateTime As DateTimeColumn = DataGrid1.Columns(5) ' Define Time Format DateTime.Format = DateTime.DateTimeFormats.HHMMSS12 ' Define separator char DateTime.DelimiterChar = ":" C# // Define DateTime variable as an object of DateTimeColumn class // and assign it to the DataGrid1 'Time' column. DateTime ColumnDateTime = (DateTimeColumn)DataGrid1.Columns[5]; // Define Time Format DateTime.Format = DateTime.DateTimeFormats.HHMMSS12; // Define separator char DateTime.DelimiterChar = ":"; |
|
![]() |
|
|
|
VB .NET ' and assign it to the DataGrid1 'Percent' column. Dim Percent As NumericColumn = DataGrid1.Columns(5) ' Identify 'Percent' column's foreground color Percent.ForeColor = Color.DarkMagenta ' Identify 'Percent' column characters' font and size Percent.Font_Name = "Tahoma" Percent.Font_Size = FontUnit.Point(8) ' Adjust 'Percent' column's width Percent.Width = Unit.Point(60) ' Define that Percent column accepts positive values only Percent.PositiveOnly = True ' Define Percent columns max length Percent.MaxLength = 8 ' Define Percent columns Decimal Length Percent.DecimalLength = 2 ' Define Percent columns max possible value Percent.MaxValue = 10000 ' Define Percent columns min possible value Percent.MinValue = 100 ' Define Percent columns error message for max value Percent.ErrMessageMaxValue = "Too much!" C# // Define Percent variable as an object of NumericColumn class // and assign it to the DataGrid1 'Percent' column. NumericColumn Percent = (NumericColumn)DataGrid1.Columns[5]; // Identify 'Percent' column's foreground color Percent.ForeColor = Color.DarkMagenta; // Identify 'Percent' column characters' font and size Percent.Font_Name = "Tahoma"; Percent.Font_Size = FontUnit.Point(8); // Adjust 'Percent' column's width Percent.Width = Unit.Point(60); // Define that Percent column accepts positive values only Percent.PositiveOnly = true; // Define Percent columns max length Percent.MaxLength = 8; // Define Percent columns Decimal Length Percent.DecimalLength = 2; // Define Percent columns max possible value Percent.MaxValue = 10000; // Define Percent columns min possible value Percent.MinValue = 100; // Define Percent columns error message for max value Percent.ErrMessageMaxValue = "Too much!"; |
|
![]() |
|
|
|
VB .NET ' and assign it to the DataGrid1 'Phone' column. Dim PhoneColumn As TextFractionsColumn = DataGrid1.Columns(5) ' Identify 'Phone' column's foreground color PhoneColumn.ForeColor = Color.DarkMagenta ' Identify 'Phone' column characters' font and size PhoneColumn.Font_Name = "Tahoma" PhoneColumn.Font_Size = FontUnit.Point(8) ' Adjust 'Phone' column's width PhoneColumn.Width = Unit.Point(60) ' Specify Delimiter Character for the field as space PhoneColumn.DelimiterChar = " " ' Specify first fraction properties ' Alphanumeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode(0, 0) = "a" ' You can insert 3 symbols only into the first fraction PhoneColumn.FractionsCode(0, 1) = 3 ' Specify second fraction properties ' Numeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode(1, 0) = "n" ' You can insert 3 symbols only into the second fraction PhoneColumn.FractionsCode(1, 1) = 3 ' Specify third fraction properties ' Numeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode(2, 0) = "n" ' You can insert 4 symbols only into the third fraction PhoneColumn.FractionsCode(2, 1) = 4 ' Define PhoneColumn columns error message for max value PhoneColumn.ErrMessageMaxValue = "Not correct phone #!" C# // Define PhoneColumn variable as an object of TextFractionsColumn class // and assign it to the DataGrid1 'Phone' column. TextFractionsColumn PhoneColumn = (TextFractionsColumn)DataGrid1.Columns[5]; // Identify 'Phone' column's foreground color PhoneColumn.ForeColor = Color.DarkMagenta; // Identify 'Phone' column characters' font and size PhoneColumn.Font_Name = "Tahoma"; PhoneColumn.Font_Size = FontUnit.Point(8); // Adjust 'Phone' column's width PhoneColumn.Width = Unit.Point(60); // Specify Delimiter Character for the field as space PhoneColumn.DelimiterChar = " "; // Specify first fraction properties // Alphanumeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode[0, 0) = "a"; // You can insert 3 symbols only into the first fraction PhoneColumn.FractionsCode[0, 1] = 3; // Specify second fraction properties // Numeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode[1, 0] = "n"; // You can insert 3 symbols only into the second fraction PhoneColumn.FractionsCode[1, 1] = 3; // Specify third fraction properties // Numeric symbols only are acceptable for the fraction PhoneColumn.FractionsCode[2, 0] = "n"; // You can insert 4 symbols only into the third fraction PhoneColumn.FractionsCode[2, 1] = 4; // Define PhoneColumn columns error message for max value PhoneColumn.ErrMessageMaxValue = "Not correct phone #!"; |
|
![]() |
|
|
VB .NET ' and assign it to the DataGrid1 'Comment' column. Dim CommentColumn As TextEditColumn = DataGrid1.Columns(5) ' Identify 'Comment' column's foreground color CommentColumn.ForeColor = Color.DarkMagenta ' Identify 'Comment' column characters' font and size CommentColumn.Font_Name = "Tahoma" CommentColumn.Font_Size = FontUnit.Point(8) ' Adjust 'Comment' column's width CommentColumn.Width = Unit.Point(60) ' Define Name of Interface Page that will be called by clicking on TextEdit button CommentColumn.InterfacePageName = "TextEditPage.html" ' Define width of Interface Page CommentColumn.InterfacePageWidth = 280 ' Define height of Interface Page CommentColumn.InterfacePageHeight = 260 ' Define if the Interface Page is scrollable CommentColumn.InterfacePageScroll = True C# // Define CommentColumn variable as an object of TextEditColumn class // and assign it to the DataGrid1 'Comment' column. TextEditColumn CommentColumn = (TextEditColumn)DataGrid1.Columns[5]; // Identify 'Comment' column's foreground color CommentColumn.ForeColor = Color.DarkMagenta; // Identify 'Comment' column characters' font and size CommentColumn.Font_Name = "Tahoma"; CommentColumn.Font_Size = FontUnit.Point(8); // Adjust 'Comment' column's width CommentColumn.Width = Unit.Point(60); // Define Name of Interface Page that will be called by clicking on TextEdit button CommentColumn.InterfacePageName = "TextEditPage.html"; // Define width of Interface Page CommentColumn.InterfacePageWidth = 280; // Define height of Interface Page CommentColumn.InterfacePageHeight = 260; // Define if the Interface Page is scrollable CommentColumn.InterfacePageScroll = true; |
![]() |
The RustemSoft ASP DataGrid UpDown Column represents a datagrid column
up-down control that displays a list's selected values. It allows you to
show a UpDown control in a Datagrid cell. The control displays in a datagrid
cell a single value that is selected from a collection by clicking the up or
down buttons of the control. The user can also enter text in the control if
the string typed in matched an item in the collection to be accepted. |
|
VB .NET ' and assign it to the DataGrid1 'State' column. Dim StateColumn As UpDownColumn = DataGrid1.Columns(3) Dim al As ArrayList = New ArrayList SQL = "SELECT * FROM States" DA = New System.Data.OleDb.OleDbDataAdapter(SQL, conStr) Dim tblStates As DataTable = New DataTable DA.Fill(tblStates) Dim row As DataRow ' Populate tblStates table's records into al ArrayList For Each row In tblStates.Rows ![]() Next StateColumn.DataSource = al ' Identify State columns background color StateColumn.BackColor = Color.LightGray ' Identify State column characters font and size StateColumn.Font_Name = "Tahoma" StateColumn.Font_Size = FontUnit.Point(8) ' Adjust State columns width StateColumn.Width = Unit.Point(30) C# // Define StateColumn variable as an object of UpDownColumn class // and assign it to the DataGrid1 'State' column. UpDownColumn StateColumn = (UpDownColumn)DataGrid1.Columns[3]; ArrayList al = new ArrayList(); SQL = "SELECT * FROM States"; DA = new System.Data.OleDb.OleDbDataAdapter(SQL, conStr); DataTable tblStates = new DataTable(); DA.Fill(tblStates); // Populate tblStates table's records into al ArrayList foreach (DataRow row in tblStates.Rows) { ![]() } StateColumn.DataSource = al; // Identify State columns background color StateColumn.BackColor = Color.LightGray; // Identify State column characters font and size StateColumn.Font_Name = "Tahoma"; StateColumn.Font_Size = FontUnit.Point(8); // Adjust State columns width StateColumn.Width = Unit.Point(30); |
![]() ![]() |
To deploy a sample web application to a web server, you have to
create a Web Setup project in MS VS .NET Environment, build it, copy it
to the Web server computer, and run the installer to install the
application on the server using the settings defined in your Web Setup
project. However it does not work for every particular server. For our
users' convenience we have prepared an instruction that describes how to
easily deploy the ASP DataGridColumns assembly samples to your web
server computer. Please follow the steps: |
![]() ![]() |
Suppose you are building a project using Visual Studio.NET, and you
decide that you want to start consuming RustemSoft ASP DataGridColumns
.NET assembly for an ASP .NET DataGrid control on your .html Page. The
first step that you will generally take is, you will add a reference to
the ASP DataGridColumns .NET assembly, which is residing in some
directory on your server. Visual Studio .NET will then add a new item
under Solution Explorer called 'References', and it will create a row
node underneath it called ASP DataGridColumns. |
Download the ASP DataGridColumns .NET assembly code samples for
|
![]() |
Copyright (C) 2001-2024 Rustemsoft LLC