Datagrid Paging alignment  
Author Message
blsandhya





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

I have a problem. When i place a DataGrid on an aspx page in Visual Studio 2005 the page no comes to the extreme left of the page. I tried changing the alignment to right or center but still it is displayed in the same manner.

If any body has a solution please let me know




Windows Forms16  
 
 
Sohail Iqbal





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi!

Select the grid and then goto properties window. Look for "PagerStyle" Property and then "HorizontalAlign". Set it as per you liking.

cheers.

Sohail.



 
 
blsandhya





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Thanks for ur reply........i think post the query in a wrong place.

The problem is not in Windows form but in webforms of VS2005.....and the solution u have written has already been tried.

If u can again give solution w.r.t datagrid of webforms... it wud b gr8



 
 
Sohail Iqbal





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi!

My answer was regarding webform and datagrid and I know you posted it in wrong forum. This is the way to do it from the information you posted and I tried it and it works fine.

Now you should post what are you doing with it. What environment,which browser what dot net version etc ..and if possible code also.

Sohail.



 
 
blsandhya





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi,

Thanx for having patience and answering a rite qn in a wrong place.

The environmnet details are as follows:

IDE:VS 2005

Dot Net version :ASP.Net 2.0

Browser: IE 6.0

OS:Windows 2003 server

The sample code is as follows

<asp:datagrid id="dgdArticles" runat="server" OnPageIndexChanged="ArticlePageChange" OnItemDataBound="FormatArticlesGrid"
AllowPaging="True" BackColor="White" width="100%" CellSpacing="1" CellPadding="3" BorderWidth="0px">

AllowPaging="True" BackColor="White" width="100%" CellSpacing="1" CellPadding="3" BorderWidth="0px">
<ItemStyle CssClass="cellContentEven" VerticalAlign="Top"></ItemStyle>
<HeaderStyle CssClass="CellHeaderodd"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemStyle VerticalAlign="Top"></ItemStyle>
<ItemTemplate>
<INPUT id="chkDelete" type="checkbox" onclick="unCheckAll();" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" CssClass="CellHeaderEven" Mode="NumericPages"></PagerStyle>
</asp:datagrid>

Ignore css styles applied.

Regards,

Sandhya



 
 
Sohail Iqbal





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi!

There is no simple solution to it. Why don't you use GridView

Sohail.



 
 
blsandhya





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi all,

Found the solution for the above mentioned problem with the help of a third party control.... which does the paging functionality which takes i/p from the built-in datagrid and then performs the total page navigation functionality...........

For more information vil write some time later......or if required you can write to me

Regards,

Sandhya



 
 
Sohail Iqbal





PostPosted: Windows Forms Data Controls and Databinding, Datagrid Paging alignment Top

Hi!

Good for you that you found the solution in the form of third party tool. And thanks for your offer, I would rather use GridView instead.

Cheers

Sohail.