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:

http://forums.asp.net/t/1176980.aspx


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -