473,387 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Customized dynamic Datagrid component - help please

Hello,

I have a page that keeps repeating many times, with different datasets, for
the site, so it only makes sense to have a component that gets used. However,
the part of the grid I haven't been able to resolve.

here is the part that I haven't found a way for it to be dynamic,
"DataItem.IntClass"?

<asp:Label id="GrideID" text='<%# DataBinder.Eval(Container,
"DataItem.IntClass") %>' runat='server' />

Also like to know of any other approaches out there, or sites with related
info.

Thanks in advance,
Reza
Nov 19 '05 #1
1 937
Hi Reza,

Actually, there is another way, codebehind, to deal with
any controls embedded in a datagrid. For example, to fill
Label, GrideID, in the datagrid, you can write code in
datagrid_ItemDataBound event:

ListItemType itemType = e.Item.ItemType;
if (itemType == ListItemType.Item || itemType ==
ListItemType.AlternatingItem){
DataRowView drv = (DataRowView)e.Item.DataItem;

Label lbl = (Label)e.FindControl("GrideID");
Lbl.Text = drv("IntClass").ToString;
// ...

}

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello,

I have a page that keeps repeating many times, with different datasets, forthe site, so it only makes sense to have a component that gets used. However,the part of the grid I haven't been able to resolve.

here is the part that I haven't found a way for it to be dynamic,"DataItem.IntClass"?

<asp:Label id="GrideID" text='<%# DataBinder.Eval (Container,"DataItem.IntClass") %>' runat='server' />

Also like to know of any other approaches out there, or sites with relatedinfo.

Thanks in advance,
Reza
.

Nov 19 '05 #2

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

Similar topics

9
by: Lina | last post by:
Hi, Can anyone tell me if it is possible to add link buttons to a datagrid that has its source set to a datatable that i have created? i.e i want the user to be able to select a room from...
0
by: JP011 | last post by:
Hello I have hit a major road block when it comes to building my dynamic datagrid. To make a long story short I need a dynamic datagrid because my connection string could change and I need the...
1
by: Jaco Karsten | last post by:
I am writing a customized DataGrid control which will allow the user to only select an entire row (and not a cell inside the row). So I want to add readonly columns to the datagrid. To achieve...
2
by: Dave Bailey | last post by:
I am trying to dynamically build a DataGrid dynamically. The code runs OK but the DataGrid is never built and displayed. Can someone look at the following code and see if they can determine what...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: raymi | last post by:
Hi, I have a custom class that gets its properties dynamically from a database at runtime. Therefore I implemented the ICustomTypeDescriptor in this class and created a a custom...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
7
by: GaryDean | last post by:
I am writing a method in a component that gets passed a 1.1 Datagrid. The datagrid's columns were created at run time meaning it has no columns collection. How can I access Header and Footer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.