When all is said and done, more will be said than done
private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { int row = e.RowIndex; int col = e.ColumnIndex; if (dgv.CurrentCell is System.Windows.Forms.DataGr... { DataGridViewCell cell = dgv.CurrentCell; DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)d... //-------------------------... // //-------------------------... bool newBool = (bool) checkCell.EditingCellFormat... ......
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: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") ......
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
select (Cast((SELECT 0 AS Active) as Bit)) AS [myCheckBox Column]
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 · 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
http://www.codeproject.com/KB/webforms/EventCalendarControl.aspx
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 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, ......
http://www.codeproject.com/aspnet/MultiSelectDropdownList.asp
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 ......
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 ......