Click here to Skip to main content
15,891,905 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem in server.transfer Pin
N a v a n e e t h10-Jul-08 18:56
N a v a n e e t h10-Jul-08 18:56 
GeneralRe: Problem in server.transfer Pin
BalasubramanianK10-Jul-08 19:25
BalasubramanianK10-Jul-08 19:25 
QuestionToggle treeview control Pin
S.Aijaz10-Jul-08 18:07
S.Aijaz10-Jul-08 18:07 
AnswerRe: Toggle treeview control Pin
N a v a n e e t h10-Jul-08 18:57
N a v a n e e t h10-Jul-08 18:57 
GeneralRe: Toggle treeview control Pin
S.Aijaz10-Jul-08 19:03
S.Aijaz10-Jul-08 19:03 
GeneralRe: Toggle treeview control Pin
S.Aijaz10-Jul-08 19:20
S.Aijaz10-Jul-08 19:20 
GeneralRe: Toggle treeview control Pin
N a v a n e e t h10-Jul-08 19:23
N a v a n e e t h10-Jul-08 19:23 
QuestionDataList in Gridview Pin
kjosh10-Jul-08 16:59
kjosh10-Jul-08 16:59 
Hi, I have the complex business object like: Ownership. Ownership object is collection of buisness objects, collection of person objects.

class Ownership

{

Collection<BusinessData> Businesses;

Collection<PersonData> Persons;

}

In the ASPX.cs Page_Load I am adding the business objects to Ownership object:

OwnerShip owners = new OwnerShip();

owners.Businesses.Add(new BusinessData("XX LLC", true, 0, 20, "pres", "", true)); XX LLC is business name.

owners.Businesses.Add(new BusinessData("YY LLP", false, 0, 20, "vice president", "", true));

In ASPx page it is like this:

<asp:GridView ID="gvOwners" runat="server" AutoGenerateColumns="False" Width="787px"

OnRowDataBound="gvOwners_RowDataBound">

<Columns>

<asp:TemplateField>

<ItemTemplate>

<asp:DataList ID="BusinessPersonDataList" runat="server">

<ItemTemplate>

<%# ((BusinessDescriptionData)Container.DataItem).BusinessName %>

</ItemTemplate>

</asp:DataList>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

Now in the RowDatabound event of GridView, I want to bind one DataList with Business colection.(in another DataList I want to bind the Persons collection, I did not put the code for this part yet. First I am trying with the Busienss objects).

The RowDataBound event is like trhe below:

protected void gvOwners_RowDataBound(object sender, GridViewRowEventArgs e)

{

OwnerShip os = null;

GridViewRow r = e.Row;

if (r.DataItem != null) // Make sure we're not in the Header or Footer row

{

os = r.DataItem as OwnerShip;

}

DataList BPDataList = e.Row.FindControl("BusinessPersonDataList") as DataList;

if (BPDataList != null && os != null)

{

BPDataList.DataSource = os.Businesses;

BPDataList.DataBind();

}

}

When I run the page, I am not getting any results. The Gridview is not displaying anything. If I remove the RowDatabound event and in the page_load gvOwners.DataSource = owners.Businesses; I have not used the datalist in this example, just binded to one Label in Gridview. Then it is displaying the results.

I think the RowDatabound event is not firing. What is the problem in the above?

Thanks in advance.
AnswerRe: DataList in Gridview Pin
N a v a n e e t h10-Jul-08 19:00
N a v a n e e t h10-Jul-08 19:00 
QuestionSetting dropdown width of Html Select control Pin
rotsey10-Jul-08 16:57
rotsey10-Jul-08 16:57 
Answer[Message Deleted] Pin
Sandeep Akhare10-Jul-08 20:59
Sandeep Akhare10-Jul-08 20:59 
GeneralRe: Setting dropdown width of Html Select control Pin
rotsey10-Jul-08 22:01
rotsey10-Jul-08 22:01 
GeneralRe: Setting dropdown width of Html Select control Pin
Sandeep Akhare10-Jul-08 22:06
Sandeep Akhare10-Jul-08 22:06 
GeneralRe: Setting dropdown width of Html Select control Pin
Sandeep Akhare10-Jul-08 22:11
Sandeep Akhare10-Jul-08 22:11 
GeneralRe: Setting dropdown width of Html Select control Pin
rotsey10-Jul-08 22:50
rotsey10-Jul-08 22:50 
GeneralRe: Setting dropdown width of Html Select control Pin
Sandeep Akhare10-Jul-08 23:27
Sandeep Akhare10-Jul-08 23:27 
AnswerRe: Setting dropdown width of Html Select control Pin
Ahmet GULBAY12-Jul-08 2:59
Ahmet GULBAY12-Jul-08 2:59 
QuestionSlider extender error: "htmlfile: Unspecified error" Pin
For_IT10-Jul-08 15:35
For_IT10-Jul-08 15:35 
QuestionProblems passing info from one asp.net page to another Pin
franciscoperezhn10-Jul-08 13:07
franciscoperezhn10-Jul-08 13:07 
AnswerRe: Problems passing info from one asp.net page to another Pin
N a v a n e e t h10-Jul-08 19:04
N a v a n e e t h10-Jul-08 19:04 
QuestionHow to get reference of a User Control inside another User Control Pin
Het210910-Jul-08 12:29
Het210910-Jul-08 12:29 
AnswerRe: How to get reference of a User Control inside another User Control Pin
N a v a n e e t h10-Jul-08 19:05
N a v a n e e t h10-Jul-08 19:05 
AnswerRe: How to get reference of a User Control inside another User Control Pin
Sandeep Akhare10-Jul-08 20:56
Sandeep Akhare10-Jul-08 20:56 
Questionrefernce to master page control [modified] Pin
gora1234510-Jul-08 10:59
gora1234510-Jul-08 10:59 
AnswerRe: refernce to master page control Pin
N a v a n e e t h10-Jul-08 19:07
N a v a n e e t h10-Jul-08 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.