how can i print a datagrid on click of a button in asp.net?
337007
use java script for that
123651
You can do it in Visual Basic by defining a subroutine that will be called just before the document is printed:\n\nPublic WithEvents appWord As Word.Application\n\nPrivate Sub appWord_DocumentBeforePrint _\n        (ByVal Doc As Document, _\n        Cancel As Boolean)\n\nDim s As Shape\n\nFor Each s In Doc.Shapes\nIf s.Type = msoTextBox Then\n    s.Line.Visible = msoFalse\n    End If\nNext s\n\nEnd Sub\n\nThe problem is, it's a little bit tricky getting this routine hooked into the application event handler.  Translation:  I didn't get it to work.  Look at the documentation for the DocumentBeforePrint event for details on what to do.
1149324
A data bound list control that displays the items from data source in a table. The DataGrid control allows you to select, sort, and edit these items.\n\nFor a list of all members of this type, see DataGrid Members.\n\nSystem.Object\n   System.Web.UI.Control\n      System.Web.UI.WebControls.WebControl\n         System.Web.UI.WebControls.BaseDataList\n            System.Web.UI.WebControls.DataGrid\n\n[Visual Basic]\nPublic Class DataGrid\n   Inherits BaseDataList\n   Implements INamingContainer\n[C#]\npublic class DataGrid : BaseDataList, INamingContainer\n[C++]\npublic __gc class DataGrid : public BaseDataList, INamingContainer\n[JScript]\npublic class DataGrid extends BaseDataList implements\n   INamingContainer\nThread Safety\nAny public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.\n\nRemarks\nUse the DataGrid control to display the fields of a data source as columns in a table. Each row in the DataGrid control represents a record in the data source. The DataGrid control supports selection, editing, deleting, paging, and sorting.\n\nDifferent column types determine the behavior of the columns in the control. The following table lists the different column types that can be used.\n\nColumn Type Description \nBoundColumn  Displays a column bound to a field in a data source. It displays each item in the field as text. This is the default column type of the DataGrid control. \nButtonColumn  Displays a command button for each item in the column. This allows you to create a column of custom button controls, such as Add or Remove buttons. \nEditCommandColumn  Displays a column that contains editing commands for each item in the column. \nHyperLinkColumn  Displays the contents of each item in the column as a hyperlink. The contents of the column can be bound to a field in a data source or static text. \nTemplateColumn  Displays each item in the column following a specified template. This allows you to provide custom controls in the column. \n\nBy default, the AutoGenerateColumns property is set to true, which creates a BoundColumn object for each field in the data source. Each field is then rendered as a column in the DataGrid control in the order that each field appears in the data source.\n\nYou can also manually control which columns appear in the DataGrid control by setting the AutoGenerateColumns property to false and then listing the columns that you want to include between the opening and closing <Columns> tags. The columns specified are added to the Columns collection in the order listed. This allows you to programmatically control the columns in the DataGrid control.\n\nNote   The order that the columns are displayed in the DataGrid control is controlled by the order that the columns appear in the Columns collection. Although you can programmatically change the order of the columns by manipulating the Columns collection, it is easier to list the columns in the desired display order.\nExplicitly declared columns can be displayed in conjunction with automatically generated columns. When using both, explicitly declared columns will be rendered first, followed by the automatically generated columns.\n\nNote   Automatically generated columns are not added to the Columns collection.\nThe appearance of the DataGrid control may be customized by setting the style properties for the different parts of the control. The following table lists the different style properties.\n\nStyle Property Description \nAlternatingItemStyle  Specifies the style for alternating items in the DataGrid control. \nEditItemStyle  Specifies the style for the item being edited in the DataGrid control. \nFooterStyle  Specifies the style for the footer section in the DataGrid control. \nHeaderStyle  Specifies the style for the header section in the DataGrid control. \nItemStyle  Specifies the style for the items in the DataGrid control. \nPagerStyle  Specifies the style for
138620
A DataGrid is not OleDb - it is something you get way downstream  from OleDb when you render the data to a Windows form or asp.net web page.\n\nAre you sure you don't have access to this data prior to rendering it? It would be far easier to grab a DataView off of a DataTable and use that for counting, than trying to count rows in a user interface element...\n\nA Windows Form DataGrid is much more iserializable style collection than an asp.net grid, and can be counted with an .Items.Count property or something close to that.
191602
source: MICROSOFT VB HELP FILES.\n\nPrint Method\n         \n\nPrints text in the Immediate window. \n\nSyntax\n\nobject.Print [outputlist]\n\nThe Print method syntax has the following object qualifier and part:\n\nPart Description \nobject Optional. An object expression that evaluates to an object in the Applies To list. \noutputlist Optional. Expression or list of expressions to print. If omitted, a blank line is printed. \n\n\n\nThe outputlist argument has the following syntax and parts:\n\n{Spc(n) | Tab(n)} expression charpos\n\nPart Description \nSpc(n) Optional. Used to insert space characters in the output, where n is the number of space characters to insert. \nTab(n) Optional. Used to position the insertion point at an absolute column number where n is the column number. Use Tab with no argument to position the insertion point at the beginning of the next print zone. \nexpression Optional. Numeric expression or string expression to print. \ncharpos Optional. Specifies the insertion point for the next character. Use a semicolon (;) to position the insertion point immediately following the last character displayed. Use Tab(n) to position the insertion point at an absolute column number. Use Tab with no argument to position the insertion point at the beginning of the next print zone. If charpos is omitted, the next character is printed on the next line. \n\n\n\nRemarks\n\nMultiple expressions can be separated with either a space or a semicolon.\n\nAll data printed to the Immediate window is properly formatted using the decimal separator for the locale settings specified for your system. The keywords are output in the appropriate language for the host application.\n\nFor Boolean data, either True or False is printed. The True and False keywords are translated according to the locale setting for the host application.\n\nDate data is written using the standard short date format recognized by your system. When either the date or the time component is missing or zero, only the data provided is written.\n\nNothing is written if outputlist data is Empty. However, if outputlist data is Null, Null is output. The Null keyword is appropriately translated when it is output.\n\nFor error data, the output is written as Error errorcode. The Error keyword is appropriately translated when it is output.\n\nThe object is required if the method is used outside a module having a default display space. For example an error occurs if the method is called in a standard module without specifying an object, but if called in a form module, outputlist is displayed on the form.\n\nNote   Because the Print method typically prints with proportionally-spaced characters, there is no correlation between the number of characters printed and the number of fixed-width columns those characters occupy. For example, a wide letter, such as a "W", occupies more than one fixed-width column, and a narrow letter, such as an "i", occupies less. To allow for cases where wider than average characters are used, your tabular columns must be positioned far enough apart. Alternatively, you can print using a fixed-pitch font (such as Courier) to ensure that each character uses only one column.
367218
hi-light what you want to print, then click print, print selection
855205
U need to call a datagrid.Update after it is deleted out of hte Grid. Or you need to re-fill the grid after u run the sqlcommand.\n\nI presonaly would create the application/webapp using the ADO.NET disconnected feature. I would create an dataset, datatable and fill the datagrid using a SqlDataAdapter. Then all you need to do is call "SqlDataAdapter.Fill" to update the Grid and to delete all you have to do is delete a row (via GUI and programaticly) and call "SqlDataAdapter.Update" to delete out of the database.\n\nEnjoy -
824550
Click on "printable view."\n\n§§
1108865
Assuming you are using WindowsXP, follow these steps;\ntools\ninternet options\ncontent\nAutoComplete\nClear forms
303462
You haven't indicated which version of ASP you want to use nor what you want to do with the data once it's read.\n\nAssuming you want to read the info into a GridView in ASP.NET 2.0:\n\nhttp://support.microsoft.com/?kbid=311731
1025746
Try this link\n\nhttp://www.google.co.uk/search?hl=en&q=flexgrid+control+in+asp.net.+If+i+use+rows+property+for+flexgrid+control+%2C+it+is+giving+error.+Why&btnG=Search&meta=
579814
you mean write javascript on a asp.net page?\n\n<script>window.alert('helloworld') </script>\n\nyou talking about Postback? im not sure
606696
hi\ntry this code by putting it into datagrid event\ntextbox txt=new textbox();\ntxt=(textbox)e.item.cell["YourCellNoWhereTextBoxIsPlaced"].controls[0];\n\nthis way u can get the whole textbox binded in the datagrid.\n\nfor any problem you can contact me at vishalsharma556@yahoo.co.in\n\n\nand for your better information this is not the better place to ask this type of questions.go to relatice sites.\n\nregards \nvishal
966661
check out http://www.pscode.com for examples.  You would need to use ADO.NET in addition to VB.NET in order to obtain the required data.
1054101
PrintForm\n\nThis will print the window.\n\nOr....\n\nPrivate Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)\n\nPrivate Function CaptureScreen(ByVal myFile As String) As Boolean\nOn Error GoTo ErrorHandler\nCall keybd_event(vbKeySnapshot, 1, 0, 0)\nSavePicture Clipboard.GetData(vbCFBitmap), myFile\nCaptureScreen = True\nExit Function\nErrorHandler:\nMsgBox "Error Occured " & Err.Description\nEnd Function\n\nPrivate Sub Command1_Click()\nCall CaptureScreen("c:&#92;screencap.bmp")\nPicture1.Picture = LoadPicture("c:&#92;screencap.bmp")\nPrinter.PaintPicture Picture1, 0, 0, Picture1.Width, Picture1.Height, 0, 0, Picture1.Width, Picture1.Height, 0\nEnd Sub
361351
You can do this with ASP>net and SQl connection object.\nYou can also use Jav and JDBC
1131137
Go to microsoft.com and search for "debugger."\n There's several--- a script debugger, VB debugger, etc. Pick the one that's designed for the debugging you want to do, although the Script Debugger will let you debug lots of different web technologies. Instructions for install and use are on the site, too.