How to use the windows screen size change deponds on the size use grid view in asp.net

Posted by Rajesh081725 under ASP.NET on 12/20/2012 | Points: 10 | Views : 1353 | Status : [Member] | Replies : 8
Hi,
Can u any one Reply

How to use if i change the windows screen size that deponds on the same size use grid view display in asp.net

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.



Responses

Posted by: Ranjeet_8 on: 12/20/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi,
You can use to design d HTML(Height n Width) in percentage not in pixels.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh081725 on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Ranjeet,
Can u send the sample source code

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somu475 on: 12/20/2012 [Member] Starter | Points: 25

Up
0
Down
Make grid view width to 90%. You can use CSS if you want.

<asp:GridView ID="GridView" runat="server" Width="90%" Height="50%"></asp:GridView>


-Somu

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh081725 on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
hi somu,
First if u run the grid view in asp.net

if i change the windows screen(maximize the screen ) ,windows screen size as like a grid view size to auto maticall change size in grid view display list of item.

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somu475 on: 12/20/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Rajesh,

I didn't get your point properly, can you explain it clearly...??

-Somu

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somu475 on: 12/20/2012 [Member] Starter | Points: 25

Up
0
Down
Rajesh,

I think you want to set both the Gridview size and its column sizes to be varied automatically according to window size.
If that is your need, then use ItemStyle-Width="15%" in all BoundFields.

Ex:
<asp:BoundField DataField="EmpID" HeaderText="EmployeeID" SortExpression="EmpID"

ItemStyle-Width="15%" />

Hope this helps you.

-Somu

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh081725 on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Gridview size and its column sizes to be varied automatically based on windows size

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somu475 on: 12/20/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Rajesh,

Try like this, use % for giving widths. Refer below code.

<asp:GridView ID="Gridview" runat="server" AutoGenerateColumns="false" DataSourceID="OdsEmployeeDetails"
Width="80%" AllowSorting="true" EmptyDataText="NO DATA FOUND">
<Columns>
<asp:BoundField DataField="EmpID" HeaderText="Employee ID" SortExpression="EmpID"
HeaderStyle-Width="25%" ItemStyle-Width="25%" />
<asp:BoundField DataField="EmpName" HeaderText="Employee Name" SortExpression="EmpName"
HeaderStyle-Width="25%" ItemStyle-Width="25%" />
<asp:BoundField DataField="EmpAddress" HeaderText="Address" SortExpression="EmpAddress"
HeaderStyle-Width="25%" ItemStyle-Width="25%" />
</Columns>
</asp:GridView>

-Somu

Rajesh081725, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response