Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Steve Hershoff #1
Adding a second row to a datagriditem?
Hi everyone,
I'm wondering if anyone has a suggestion on how to do this, or if it's even
possible.
In my datagrid's OnItemDataBound function I'd like to somehow "add" a child
row beneath one of the datagriditems (chosen via a QueryString variable) and
use it to hold a secondary datagrid. It would act as a drilldown of sorts,
showing more information not displayed in the datagriditem itself.
I know I can add this new datagrid to one of the datagriditem's existing
cells, but I can't get it to span multiple columns without shoving aside the
other columns in the datagriditem. That's where my idea of this second row
has come from. So far I'm not having any luck however.
If you know of some way I can pull this off (or a reasonable facsimile
thereof) I'd be grateful. Thanks very much!
-Steve
Steve Hershoff Guest
-
Casting DataGridItem
agrids on six different pages which are editable. They each draw from a different SQLServer table. 2. When data is changed in any rows, the Row... -
DataGridItem.DataItem property?
The help pages make it look like the DataGridItem.DataItem property would return a row from the bound table. Like so: //(during setup)... -
DataGrid Built In Paging and DataGridItem Problem
Hi All: I am populating a Data Table with File/Folder information from my drive... I am then binding this data table to a DataGrid. Due to the... -
ItemCreate event handler changes wrong DataGridItem
I am changing the EditText in a EditCommandColumn in a DataGrid in an ItemCreate event handler . The only problem I am having is that instead of... -
Problems with casting DataGridItem.findcontrol and DataGridItem.cells(0).control(1) to checkbox
this peace of code is giving me trouble DIM i as DataGridItem for each i in myDataGrid checkbox chkbox =... -
Kumar Reddi #2
Re: Adding a second row to a datagriditem?
you should use datalist instead.. you will have more control on the HTML.
I had the same issue in my recent project.. initially i tried with datagrids
like you are doing.. but couldnt succeed.. so went with datalist's and it
worked like a charm
"Steve Hershoff" <babbaloo@nowhere.com> wrote in message
news:%23Su6k4nuGHA.476@TK2MSFTNGP06.phx.gbl...> Hi everyone,
>
> I'm wondering if anyone has a suggestion on how to do this, or if it's
> even possible.
>
> In my datagrid's OnItemDataBound function I'd like to somehow "add" a
> child row beneath one of the datagriditems (chosen via a QueryString
> variable) and use it to hold a secondary datagrid. It would act as a
> drilldown of sorts, showing more information not displayed in the
> datagriditem itself.
>
> I know I can add this new datagrid to one of the datagriditem's existing
> cells, but I can't get it to span multiple columns without shoving aside
> the other columns in the datagriditem. That's where my idea of this
> second row has come from. So far I'm not having any luck however.
>
> If you know of some way I can pull this off (or a reasonable facsimile
> thereof) I'd be grateful. Thanks very much!
>
> -Steve
>
Kumar Reddi Guest
-
Patrick.O.Ige #3
Re: Adding a second row to a datagriditem?
As kumar explained use Datalist like so
in ur ItemDataBund do
Dim mychilddl As DataList =
CType(e.Item.FindControl("idofdatalistinsidethepar entdatalist"), DataList)
and then add control
e.item.controls.Add(mychilddl)
hope that helps
Patrick
"Kumar Reddi" <kumarreddi@gmail.com> wrote in message
news:OvcRYBouGHA.4968@TK2MSFTNGP03.phx.gbl...> you should use datalist instead.. you will have more control on the HTML.
>
> I had the same issue in my recent project.. initially i tried with
> datagrids like you are doing.. but couldnt succeed.. so went with
> datalist's and it worked like a charm
>
> "Steve Hershoff" <babbaloo@nowhere.com> wrote in message
> news:%23Su6k4nuGHA.476@TK2MSFTNGP06.phx.gbl...>>> Hi everyone,
>>
>> I'm wondering if anyone has a suggestion on how to do this, or if it's
>> even possible.
>>
>> In my datagrid's OnItemDataBound function I'd like to somehow "add" a
>> child row beneath one of the datagriditems (chosen via a QueryString
>> variable) and use it to hold a secondary datagrid. It would act as a
>> drilldown of sorts, showing more information not displayed in the
>> datagriditem itself.
>>
>> I know I can add this new datagrid to one of the datagriditem's existing
>> cells, but I can't get it to span multiple columns without shoving aside
>> the other columns in the datagriditem. That's where my idea of this
>> second row has come from. So far I'm not having any luck however.
>>
>> If you know of some way I can pull this off (or a reasonable facsimile
>> thereof) I'd be grateful. Thanks very much!
>>
>> -Steve
>>
>
Patrick.O.Ige Guest
-
Gaurav Vaish \(www.EduJini.IN\) #4
Re: Adding a second row to a datagriditem?
> In my datagrid's OnItemDataBound function I'd like to somehow "add" a
Do not override OnItemDataBound but handle the event ItemCreated or> child row beneath one of the datagriditems (chosen via a QueryString
> variable) and use it to hold a secondary datagrid. It would act as a
> drilldown of sorts, showing more information not displayed in the
> datagriditem itself.
ItemDataBound.
ItemDataBound is raised after ItemCreated and only for non-pager items.
Note that the DataGridItem itself is a sub-class of TableRow meaning
that you are working with a Table Row indirectly.
However, keep a caution that if you directly manipulate the TableRow or
its container Table, you may lose out the functionality related to the
DataGrid... like DataBinding etc. But as what I see, that seems (or should
be) ok with you since you'd be handling it yourself.
--
Happy Hacking,
Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
[url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
-------------------
Gaurav Vaish \(www.EduJini.IN\) Guest



Reply With Quote

