Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > custom DataGrid placement on page?

Reply
Thread Tools

custom DataGrid placement on page?

 
 
Andre
Guest
Posts: n/a
 
      10-21-2003
I've searched for this but haven't found an answer.

Is it possible to customize a datagrid's location on the page in
run-time?

I have two datagrids, one on top of the other. I'm not currently using
paging as the query feeding the uppder grid is only returning the TOP
20 records. I'd like to customize the placement of the lower datagrid
that, if the uppder dg contains over 12 services, the lower one is
moved downwards so many pixels for every additional row over 12.

Thanks in advance for any suggestions or c# snippets that might be
useful.

Thanks,

Andre
 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      10-22-2003
how about the datagrids top and left attribute
if(DataGrid2.Height == 20)
{
DataGrid1.Attributes.Add("top","10");
DataGrid1.Attributes.Add("left","10");
}
roughly
--


-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Andre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I've searched for this but haven't found an answer.
>
> Is it possible to customize a datagrid's location on the page in
> run-time?
>
> I have two datagrids, one on top of the other. I'm not currently using
> paging as the query feeding the uppder grid is only returning the TOP
> 20 records. I'd like to customize the placement of the lower datagrid
> that, if the uppder dg contains over 12 services, the lower one is
> moved downwards so many pixels for every additional row over 12.
>
> Thanks in advance for any suggestions or c# snippets that might be
> useful.
>
> Thanks,
>
> Andre



 
Reply With Quote
 
 
 
 
Eddie B.
Guest
Posts: n/a
 
      10-22-2003
Place your datagrid into a HTM label (not webforms label) then you can hide
or make it appear as well as moving location. This will also make your grid
scrolling so you won't have to worry about paging. Good Luck!



"Andre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I've searched for this but haven't found an answer.
>
> Is it possible to customize a datagrid's location on the page in
> run-time?
>
> I have two datagrids, one on top of the other. I'm not currently using
> paging as the query feeding the uppder grid is only returning the TOP
> 20 records. I'd like to customize the placement of the lower datagrid
> that, if the uppder dg contains over 12 services, the lower one is
> moved downwards so many pixels for every additional row over 12.
>
> Thanks in advance for any suggestions or c# snippets that might be
> useful.
>
> Thanks,
>
> Andre



 
Reply With Quote
 
Andre
Guest
Posts: n/a
 
      10-22-2003
That was a huge help. Thank you!!
 
Reply With Quote
 
Andre
Guest
Posts: n/a
 
      10-22-2003
I'm afraid the solution is still eluding me, I'd appreciate some extra
help.

The datagrid control has the following attributes on the asp page. I'm
trying to modify the TOP portion of the style attribute.

<asp:datagrid id="dgScheduledToday" style="Z-INDEX: 119; LEFT: 160px;
POSITION: absolute; TOP: 512px" runat="server" Height="60px"
Font-Names="Arial" Font-Size="Smaller" AutoGenerateColumns="False"
CellPadding="0" AllowSorting="True" AllowCustomPaging="True"
BorderStyle="Dotted" Width="608px"
PageSize="4">

I've tried inserting the following snippet into the code-behind, but
it has no effect on page rendering.
dgScheduledToday.Attributes.Add("TOP: ", "700px");

I've also tried with no success:
dgScheduledToday.Attributes.Add("style=", "TOP: 700px");

I've got a breakpoint set on this line and it is executing, so I can
rule out the if() statement at this point.

Again, Thanks.
 
Reply With Quote
 
Alvin Bruney
Guest
Posts: n/a
 
      10-23-2003
incorrect syntax
("top","10")
not ("top:","10")

--


-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Andre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I'm afraid the solution is still eluding me, I'd appreciate some extra
> help.
>
> The datagrid control has the following attributes on the asp page. I'm
> trying to modify the TOP portion of the style attribute.
>
> <asp:datagrid id="dgScheduledToday" style="Z-INDEX: 119; LEFT: 160px;
> POSITION: absolute; TOP: 512px" runat="server" Height="60px"
> Font-Names="Arial" Font-Size="Smaller" AutoGenerateColumns="False"
> CellPadding="0" AllowSorting="True" AllowCustomPaging="True"
> BorderStyle="Dotted" Width="608px"
> PageSize="4">
>
> I've tried inserting the following snippet into the code-behind, but
> it has no effect on page rendering.
> dgScheduledToday.Attributes.Add("TOP: ", "700px");
>
> I've also tried with no success:
> dgScheduledToday.Attributes.Add("style=", "TOP: 700px");
>
> I've got a breakpoint set on this line and it is executing, so I can
> rule out the if() statement at this point.
>
> Again, Thanks.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom placement for vector sreedhar.cs@gmail.com C++ 4 05-21-2006 03:43 AM
Update Custom Collection that is bound to DataGrid made up of Custom COlumns Terry Holland ASP .Net Datagrid Control 9 10-28-2005 06:20 AM
Default Cursor Placement Bob Firefox 2 02-25-2005 05:17 AM
firewall placement and choice of firewalls Joe Dewberry Cisco 0 12-09-2003 05:39 PM
Relative placement constraints in VHDL for Virtex multipliers Jack Stone VHDL 1 07-25-2003 08:12 PM



Advertisments