asp.net - Unable to fit data into the GridView cell with in fixed width -
i have column has has long text have scroll end see it. can out fitting content in fixed width cell
ui:
<asp:gridview id="gridview1" runat="server" onpageindexchanging="pageindexchanging_click" style="height: 166px; width: 217px; z-index: 1; left: 16px; top: 252px; position: absolute" emptydatatext="no records within time frame" > <pagersettings lastpagetext="last" /> </asp:gridview> //code behind: private void getdata() { string fromdata = txt_fromdate.text;//" '2013-09-23 11:06:00.077'"; string todate = txt_todata.text;//" '2013-09-23 11:28:25.163' "; string querstring = "select * gt_transaction_log logtimestamp between" +"'"+ fromdata +"'"+ " , " +"'"+ todate + "'"; sqldataadapter adapter = new sqldataadapter(querstring, conn); datatable dt = new datatable(); gridview1.allowpaging = true; if (textbox1.text != "" && int.parse(textbox1.text) != 0) { gridview1.pagesize = int.parse(textbox1.text); } else { gridview1.pagesize = 10; } adapter.fill(dt); gridview1.datasource = dt; gridview1.databind(); }
gridview doesn't have style property, have cssclass property can use control css.
create css in style block:
<style type="text/css"> .gridviewstyle { height: 166px; width: 217px; z-index: 1; left: 16px; top: 252px; position: absolute } </style>
then in gridview, it'll this:
<asp:gridview cssclass="gridviewstyle" <!-- additional gv fields here -->> </asp:gridview>
Comments
Post a Comment