473,545 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add pager control for Composite Control.

Hi,

I am unable to add a pager for this composite control.

I had created a composite control in C#. The control is having 5 labels, one radio button and one DropDownList control. The composite control should display 2 columns and 2 rows per page. I am able to display 4 Composite Controls independently, when the user is changing the index of the DropDownList control, automatcially the output should get reflected on the composite control itself.

The source code for the above:

// Start Creating Meter Controls max 4

try
{
int j=0;
HtmlTableCell tblCell;
HtmlTableRow tr;
IList iMeterId = mc.GetAllMeterI d(Convert.ToInt 32(Session["UserId"]));

if(iMeterId.Cou nt == 0)
{
tr = new HtmlTableRow();
tblCell = new HtmlTableCell() ;
tblMeter.BgColo r = "lightsteelblue ";
tblCell.VAlign = "top";
tblCell.InnerHt ml = "<label class='errorLab el'>There are no meters found.</label>";
tr.Cells.Add(tb lCell);
tblMeter.Rows.A dd(tr);
bAfterLoad=fals e;
}
else
{
for(int k=0;k<iMeterId. Count;)
{
tr = new HtmlTableRow();
if(k>=4)
{
break;
}

for(int i=0;i<2;i++)
{
if(j==iMeterId. Count)
{
break;
}
//Creating Cell
tblCell = new HtmlTableCell() ;
tblCell.Width = "33%";
tblCell.VAlign = "top";
meter = (MeterControl) Page.LoadContro l("MeterControl .ascx");
meter.MeterId = Convert.ToInt32 (iMeterId[j]);
meter.OptMeterI d = Convert.ToInt32 (iMeterId[j]);
meter.ID = "MeterId" + (i+k);
tblCell.Control s.Add(meter);
tr.Cells.Add(tb lCell);

tblCell = null;
meter = null;
j++;
}
k+=2;
tblMeter.Rows.A dd(tr);
}
bAfterLoad=true ;
}
catch{}
Nov 16 '05 #1
0 1580

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
953
by: Hartmut Schroth | last post by:
Hello, I have build a pager for a datalist control according to John Kilgo's article in DotNetJohn.com. It is working fine, but according to my page property "SmartNavigation=True" the following pages are always positioned to where I place the pager (e.g. at the end of the list). The method, to take a hidden ancor control with URL...
2
3160
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the problems that I have encountered to date and the solutions (if any) that I found....
1
2079
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to do format because it's in a Datagrid pager area. The html code generated for pager is one sigle cell with lots of colspan. I tried to add some...
1
1736
by: Fabricio Sperandio | last post by:
Hi everyone, where can I find a Pager Control for a DataList. I mean, some code example or a free Web Control. I only found examples using SQL Server, I am using Access. I some like the Pager control for ASP .NET 2.0 able to pager DataList, Repeater... with Access! Thank you, Fabrício Sperandio
0
1228
by: James T. | last post by:
Hello! I am using following code to customize DataGrid Pager. It works fine... My question is, how I can replace"&nbsp" with " | " between each LinkButton control? Thanks! James Dim pager As TableCell
7
2975
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
1811
by: Ray | last post by:
I am trying to add a "Next >" and "<Prev" button to the pager of my datagrid. I have been able to add the hyperlinks to the pager. I am now trying to determine the correct postback script to emulate so that these hyperlinks force the postback of the appropriate linkbuttons in the pager. Let's take a pager with pager: 1 2 3 4 5 It consists...
3
1939
by: Eric | last post by:
I have created a fairly basic composite control consisting of a Label and a TextBox. In the overridden Render function, I'm creating a table with two rows and each row contains a cell (td). The Label and the TextBox are each rendered in one of the cells. Everything renders fine. The problem is that depending on the column the control...
6
2617
by: shapper | last post by:
Hello, I am working in a class library with various custom controls. In which cases should a control inherit Control, WebControl and CompositeControl classes? And when should a custom control implement INamingContainer? In this moment I am working on a custom control that is composed by a
0
7393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7411
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1871
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
695
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.