GridView, Datagrid, DataList & Repeater

Capture DataGridView CheckBox Checked event on a WinForm

Private Sub dgv_CurrentCellDirtyStateCh... sender As System.Object, ByVal e As System.EventArgs) Handles dgv.CurrentCellDirtyStateCh... '--------------------------... 'when a user checks/unchecks a checkbox 'perform "commitEdit" so that "CellValueChanged" event gets fired '--------------------------... If dgv.IsCurrentCellDirty Then dgv.CommitEdit(DataGridView... End If End Sub Private Sub dgv_CellValueChanged(ByVal...

ASP.NET Export n GridViews to Excel

ASP.NET Export n GridViews to Excel Thanks to awesome article by Matt Berseth http://mattberseth.com/blog... http://forums.asp.net/t/152... //Web Page Call to ExcelExport Class protected void lnkExport_Click(object sender, EventArgs e) { //creating the array of GridViews and calling the Export function GridView[] gvList = new GridView[] { gvPlateList, gvPlateDetails }; ExcelExport.Export("Deliver... gvList); } //ExcelExport Class using System;...

ASP.NET Conditionally Change ButtonField text at runTime

ASP.NET Conditionally Change ButtonField text at runTime <asp:ButtonField CommandName="Edit" HeaderText="" Text="Edit" ButtonType="Link" /> protected void gvRequests_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //-------------------------... // If status = "Saved", change buttonField.LinkButton.Text to "Copy" //-------------------------... if (e.Row.Cells[(int)gCol.Stat... == "Saved")...

windows datagridview hide cell CellPainting

Private Sub dgCompounds_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGr... Handles dgCompounds.CellPainting Try '--------------------------... 'if POS = <blank> , hide 'Punch' checkbox in cell '--------------------------... If e.RowIndex > -1 And e.ColumnIndex > -1 Then If Me.dgCompounds.Columns(e.Co...

create a WinForms DataGridView checkbox column via databinding on dummy a SQL column

create a WinForms DataGridView checkbox column via databinding on dummy a SQL column select (Cast((SELECT 0 AS Active) as Bit)) AS [myCheckBox Column]

Get a Weak or Strong DataTable Row from a selected DataGridView row.

Get a Weak or Strong DataTable Row from a selected DataGridView row. Private Sub btnGetDataGridViewSelectedR... sender As System.Object, ByVal e As System.EventArgs) Handles btnGetDataGridViewSelectedR... '--------------------------... 'Find the first selected row (should only be zero or one since DataGridView1.SelectionMode = FullRowSelect) '--------------------------...

DataGridView CSV Editor

DataGridView CSV Editor · Load CSV File into Dataset -> DataGridView · Show cells with Validation Errors with backcolor & tooltip · Right-Click cell to correct cell via tooltip · Restrict KeyPress Keys · Show cell as “edited” via cell backcolor Public Function GetCSVDataTable(ByVal filePath As String) As DataTable ' The dataset to return Dim dt As DataTable = Nothing Try '--------------------------... ' Create "Excel Like" Column Headers '--------------------------...

Gantt Chart - EventCalendarControl

Gantt Chart - EventCalendarControl http://www.codeproject.com/

GridViewRow Edit, disable column(s)

When user clicks GridViewRow Edit, depending on the data in the GridViewRow, enable/disable column(s) Protected Sub GridView1_RowDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.G... Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim Offline_MediaId As Integer = Integer.Parse(e.Row.Cells(1... If Offline_MediaId > 4 Then 'Dim textBox As TextBox = CType(e.Row.FindControl("tx... TextBox) 'textBox.Enabled...

ASP.NET Sort List Control

ASP.NET Sort List Control Protected Sub btnLeft_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLeft.Click While (Me.lsRight.Items.Count > 0 And Me.lsRight.SelectedItem IsNot Nothing) Dim selectedItem As ListItem = Me.lsRight.SelectedItem selectedItem.Selected = False Me.lsLeft.Items.Add(selecte... Me.lsRight.Items.Remove(sel... End While SortListControl(lsLeft, True) SortListControl(lsRight, True) End Sub Protected Sub btnRight_Click(ByVal sender As System.Object,...

Multi select Dropdown list in ASP.NET

http://www.codeproject.com/

Change Datagrid Header At RunTime

Private Sub dgList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.D... Handles dgList.ItemDataBound If e.Item.ItemType.ToString() = "Header" Then '--------------------------... ' rename DataGrid Columns '--------------------------... Dim i As Integer Dim objDataViewerAPI = New DataViewerAPI For i = 0 To e.Item.Cells.Count - 1 Dim ColumnNameRaw...

Complex Repeater and DataList Controls Made Simple

excellent original article by Michael Libby: ttp://aspalliance.com/811_C

Making Rows in an Editable DataGrid Un-Editable

Making Rows in an Editable DataGrid Un-Editable original article by : Scott Mitchell http://datawebcontrols.com/... Private Sub dgSchedules_ItemDataBound(B... sender As Object, ByVal e As System.Web.UI.WebControls.D... Handles dgSchedules.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then 'Columns {templateColumn = 0, Date, Amount, BU_Name, BU_Id = 4} Dim bu As String = e.Item.Cells(4).Text...