Hi,
I'm using a datagrid, and the sub ItemDataBound to customize output of my
datagrid when it is bound. Is the only way I can access the data in my
datasource is to use
DataBinder.Eval (e.Item.DataIte m, "myFieldNam e")
It just seems to be a little clunky to have to use this for every varible in
my datasource, even more when using "option strict" you have to cast the
result, making for an even longer statement. This isn't that much of a
problem, i'm just wondering if i'm missing something that would be much
easier.
Thanks,
--Michael 1 1297
After the datagrid is bound you can loop through and format the items
e.g datagrid.items( 0).cells(0).tex t
Hope this helps
Srinivas
"Raterus" <raterus@localh ost> wrote in message
news:e6******** ******@TK2MSFTN GP12.phx.gbl... Hi,
I'm using a datagrid, and the sub ItemDataBound to customize output of my datagrid when it is bound. Is the only way I can access the data in my datasource is to use
DataBinder.Eval (e.Item.DataIte m, "myFieldNam e")
It just seems to be a little clunky to have to use this for every varible
in my datasource, even more when using "option strict" you have to cast the result, making for an even longer statement. This isn't that much of a problem, i'm just wondering if i'm missing something that would be much easier.
Thanks, --Michael
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: shamila |
last post by:
</asp:label><asp:datagrid id="DataGrid3" runat="server"
cssclass="DataGrid" showfooter="True"
onupdatecommand="DataGrid3_Update"ondeletecommand="DataGrid3_Delete"
oneditcommand="DataGrid3_Edit" oncancelcommand="DataGrid3_Cancel"
caption="Pricing Schedules" autogeneratecolumns="False"
OnItemDataBound="ItemDataBoundEventHandler">
<alternatingitemstyle cssclass="DataGrid_AlternatingItemStyle" />
<columns>
<asp:templatecolumn...
|
by: Rick |
last post by:
Hello all, I hope all is well with you.
I am having a seriously difficult time with this problem. Allow me to
set
up the problem.
I have a System.Web.UI.Page with the following controls (watch the
layout,
some have child controls):
|
by: bill yeager |
last post by:
I have a datalist displaying parent information and a
datagrid presenting child information. The data is being
rendered just fine. The datagrid has template columns on
it that I cannot gain access to in my Itemcommand event
of the datalist.
When I press a button on the datalist, that brings me
into the Itemcommand event. I have access to the datagrid
control, but not any column controls on the datagrid. For
instance, my first column is...
|
by: bill yeager |
last post by:
I did some more debugging and found the following:
1) I placed the following code in the button event just
to see if I could cycle thru the datagrid control
collection:
<code>
Dim strhello As String
Dim myDataListItem As DataListItem
Dim myDatagridItem As DataGridItem
Dim myCheckBox As CheckBox
|
by: CVerma |
last post by:
Hi,
I have an embedded datagrid within a datalist. I am not able to
perfrom paging in the datagrid. Any ideas? Here is my code:
Here is my Simplegrid.cs file:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
| |
by: tshad |
last post by:
Is there a way to carry data that I have already read from the datagrid from
page to page?
I am looking at my Datagrid that I page through and when the user says get
the next page, I have to go to the database to get the next page. Is there
a way to use the dataset to allow us to read back and forth in it instead of
going back to the database to get it?
Thanks,
|
by: Wyatt70 |
last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid.
The calendar will be used to insert a date into a textbox. I keep
getting a "System.NullReferenceException: Object reference not set to
an instance of an object" error, which points to the following line:
lnkCalendar.Attributes("OnClick") =
String.Format("window.open('Calendar.aspx?textbox={0}','cal','...')",
txtEstimatedDeploy)
Here is the complete code for the...
|
by: Brock |
last post by:
First note that I am using Framework 1.1. I have an .aspx page that is
displaying a list of employees, but only the Employee Number, First
Name, Last Name, and Title. It is working great. I recessed it in a
<Div></Divto allow scrolling of just the data, not the page. What I
need to do is place a DataList (also in a <Div></Divto allow
scrolling of just the data) to the right of the Datagrid to show 40
Employee Detail fields (listed top to...
|
by: Brock |
last post by:
Thanks in advance... (you can see a screenshot of what my form looks
like currently at http://www.juggernautical.com/DataGrid.jpg - the
Datalist is super-imposed in 'design view' but the DataGrid is the
actual running of the page) I've almost got this working (?) but need
a little help. I have an .aspx page that has a DataGrid listing
employees with a "Select" button that is to be used to populate the
DataList to the right of the DataGrid...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |