c# - Grid Items to fill the screen ... xaml -
how can set size of grid items in gridview control items auto re-size fill screen . example if there 2 items each fill half of screen , if there 3 each take third , on ..
use itemstyle.width
property on column definition.
if not using autogenerated
columns, set width of columns interested in.
if using dynamically generated columns, need set width in code behind.
refer following:
protected void textbox1_textchanged (object sender, eventargs e) { label1.text = ""; try { int colwidth = int16.parse(server.htmlencode(textbox1.text)); if (colwidth > 0) { (int = 0; < gridview1.columns.count; i++) { gridview1.columns[i].itemstyle.width = colwidth; } } } catch { label1.text = "an error occurred." } }
check msdn:
http://msdn.microsoft.com/en-us/library/ms178296.aspx
referance link:
Comments
Post a Comment