C# .NET - show datagridview head subscript ??????????

Asked By avula
03-Feb-12 06:57 AM
hi every one,

i need to show the datagridview's head should be centigrad(0C)

thanks
  Reena Jain replied to avula
03-Feb-12 07:22 AM
Hi,

Simply you can use use the SUP tag available in html like this

<label>Mc<sup>2</sup></label>
  avula replied to Reena Jain
03-Feb-12 07:39 AM
i want it in windows datagridview header, please help me
  Ahi I replied to avula
03-Feb-12 08:00 AM
Use grid view properties....
Create New Account
help
Create an Excel .xls file from a datagridview? .NET Framework I have a Windows forms application that features a DataGridView. I want to give the users an option to save that data to an Excel forcing a garbage collection, etc.) It didn't seem very "clean". The data in the datagridview is not data that came from a dataset. I could force it into a datatable TheGrid.DataSource (1) TheGrid.RowCount (1) Office (1) Excel (1) Try this, simply pass the DataGridView and filename i.e. MyResults.xls to the sub to create the Excel file in format. Module ExportToExcel_Raw ''' <summary> ''' Creates a simple MS-Excel spreadsheet from data residing in a DataGridView ''' < / summary> ''' DataGridView currently with data ''' Path and filename to write an excel wookbook too ''' <remarks> ''' REQUIRES CHANGE IN APPLICATIONS AS PER COMMENTS IN THE CATCH. ''' < / remarks> Public Sub ExportGridToExcel(ByVal TheGrid As DataGridView, ByVal FileName As String) If TheGrid.DataSource Is Nothing Then Throw New Exception("No data fs As New IO.StreamWriter(FileName, False) fs.WriteLine("<?xml version = ""1.0""?> ") fs.WriteLine("<?mso-application progid = ""Excel.Sheet""?> ") fs.WriteLine("<ss:Workbook xmlns:ss = ""urn:schemas-microsoft-com:office
how to create table in sql server from either a datagridview or excel file .NET Framework Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons: 1) export to excel button exports the visible columns from the datagridview to excel (this works fine) 2) create temp table: this is what I am stuck know how to make it work. I need to export the VISIBLE COLUMNS from the datagridview into a newly created table in a database in sql server. I want to create the table on the fly here with the visible columns from the datagridview. What is the best way to achieve item 2)??? Thanks a lot for your help Windows.Forms.Cursors.Default 'cmd.Connection.Close() End Sub Private Sub exportExcel(ByVal grdView As DataGridView, ByVal fileName As String, _ ByVal fileExtension As String, ByVal filePath As String) ' Choose the fs As New IO.StreamWriter(myFile, False) fs.WriteLine("<?xml version = ""1.0""?> ") fs.WriteLine("<?mso-application progid = ""Excel.Sheet""?> ") fs.WriteLine("<ss:Workbook xmlns:ss = ""urn:schemas-microsoft- com:office Row> ") ' Check for an empty row at the end due to Adding allowed on the DataGridView Dim subtractBy As Integer If grdView.AllowUserToAddRows = True Then subtractBy = 2 Else subtractBy = 1 ' Write
not by passing flag to your function, just see the function below private void ExportDataToExcel(DataGridView datagridview, bool IsShowIsCaptions) { object objMainApp; object objWorkBook; object objWorkBooks; object objWorkSheets; object objWorkSheet; object objCellRange; object [] Parameters; string [] headers = new string [datagridview.ColumnCount - 1]; string [] columns = new string [datagridview.ColumnCount - 1]; int i = 0; int c = 0; for (c = 0; c datagridview.ColumnCount - 1; c++) { headers[c] = datagridview.Rows[0].Cells[c].OwningColumn.Name.ToString(); columns[c] = Convert.ToString(( char )i); } try { Type objWorkSheets.GetType().InvokeMember( "Item" , BindingFlags.GetProperty, null , objWorkSheets, Parameters); if (IsShowIsCaptions) { for (c = 0; c < datagridview.ColumnCount - 1; c++) { Parameters = new Object[2]; Parameters[0] = columns[c] + "1" ; Parameters[1] = Missing headers[c]; objCellRange.GetType().InvokeMember( "Value" , BindingFlags.SetProperty, null , objCellRange, Parameters); } } for (i = 0; i < datagridview.RowCount; i++) { for (c = 0; c < datagridview.ColumnCount - 1; c++) { Parameters = new Object[2]; Parameters
not by passing flag to your function, just see the function below private void ExportDataToExcel(DataGridView datagridview, bool IsShowIsCaptions) { object objMainApp; object objWorkBook; object objWorkBooks; object objWorkSheets; object objWorkSheet; object objCellRange; object [] Parameters; string [] headers = new string [datagridview.ColumnCount - 1]; string [] columns = new string [datagridview.ColumnCount - 1]; int i = 0; int c = 0; for (c = 0; c datagridview.ColumnCount - 1; c++) { headers[c] = datagridview.Rows[0].Cells[c].OwningColumn.Name.ToString(); columns[c] = Convert.ToString(( char )i); } try { Type objWorkSheets.GetType().InvokeMember( "Item" , BindingFlags.GetProperty, null , objWorkSheets, Parameters); if (IsShowIsCaptions) { for (c = 0; c < datagridview.ColumnCount - 1; c++) { Parameters = new Object[2]; Parameters[0] = columns[c] + "1" ; Parameters[1] = Missing headers[c]; objCellRange.GetType().InvokeMember( "Value" , BindingFlags.SetProperty, null , objCellRange, Parameters); } } for (i = 0; i < datagridview.RowCount; i++) { for (c = 0; c < datagridview.ColumnCount - 1; c++) { Parameters = new Object[2]; Parameters