473,396 Members | 1,886 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,396 software developers and data experts.

Datasource in MultiView

Not sure how to word this, so if it seems like I'm rambling, sorry..

I have a MultiView object on my form, with a Grid showing a list, with
"Edit", "Select" and "Delete" links. Here's the definition:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="ArticleViewDataSource"
OnRowCommand="GridView1_RowCommand">
<Columns>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" />
<asp:BoundField DataField="ArticleTitle"
HeaderText="ArticleTitle" SortExpression="ArticleTitle" />
</Columns>
</asp:GridView>

Now, as you can see, I have an event handler handling the "OnRowCommand"
event. That method basically changes the view to one that contains a
FormView.

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
articleSelectedValue = int.Parse(
MultiView1.SetActiveView(ArticleEditView);
}

The FormView's datasource has a parameter that I have bound to the GridView
control like so:
<asp:ObjectDataSource ID="ArticleDataSource" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetArticleByArticleId"
TypeName="NewsArticleManager">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
DefaultValue="0" Name="articleId" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

This doesn't seem to work though. The view changes correctly, but the
articleId being passed is a 0, and thereby displaying nothing.

When I inspect the value of GridView1.SelectedValue on the event handler, it
is null. Not sure if that is the best way to do that.

Any suggestions would be appreciated.

Jun 24 '07 #1
2 2540
On Jun 24, 6:04 am, "Bryce" <b...@berzerker-soft.comwrote:
Not sure how to word this, so if it seems like I'm rambling, sorry..

I have a MultiView object on my form, with a Grid showing a list, with
"Edit", "Select" and "Delete" links. Here's the definition:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="ArticleViewDataSource"
OnRowCommand="GridView1_RowCommand">
<Columns>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" />
<asp:BoundField DataField="ArticleTitle"
HeaderText="ArticleTitle" SortExpression="ArticleTitle" />
</Columns>
</asp:GridView>

Now, as you can see, I have an event handler handling the "OnRowCommand"
event. That method basically changes the view to one that contains a
FormView.

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
articleSelectedValue = int.Parse(
MultiView1.SetActiveView(ArticleEditView);
}

The FormView's datasource has a parameter that I have bound to the GridView
control like so:
<asp:ObjectDataSource ID="ArticleDataSource" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetArticleByArticleId"
TypeName="NewsArticleManager">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
DefaultValue="0" Name="articleId" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

This doesn't seem to work though. The view changes correctly, but the
articleId being passed is a 0, and thereby displaying nothing.

When I inspect the value of GridView1.SelectedValue on the event handler, it
is null. Not sure if that is the best way to do that.

Any suggestions would be appreciated.
Hi...

do it manually
onrowcommad get the articleid and then
use it to populate the from view....
even though its not that good... but for now it will save you...

Thanks
Masudur

Jun 24 '07 #2

"Masudur" <mu*****@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
On Jun 24, 6:04 am, "Bryce" <b...@berzerker-soft.comwrote:
>Not sure how to word this, so if it seems like I'm rambling, sorry..

I have a MultiView object on my form, with a Grid showing a list, with
"Edit", "Select" and "Delete" links. Here's the definition:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="ArticleViewDataSource"
OnRowCommand="GridView1_RowCommand">
<Columns>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" />
<asp:BoundField DataField="ArticleTitle"
HeaderText="ArticleTitle" SortExpression="ArticleTitle" />
</Columns>
</asp:GridView>

Now, as you can see, I have an event handler handling the "OnRowCommand"
event. That method basically changes the view to one that contains a
FormView.

protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
articleSelectedValue = int.Parse(
MultiView1.SetActiveView(ArticleEditView);
}

The FormView's datasource has a parameter that I have bound to the
GridView
control like so:
<asp:ObjectDataSource ID="ArticleDataSource" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetArticleByArticleId"
TypeName="NewsArticleManager">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
DefaultValue="0" Name="articleId" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

This doesn't seem to work though. The view changes correctly, but the
articleId being passed is a 0, and thereby displaying nothing.

When I inspect the value of GridView1.SelectedValue on the event handler,
it
is null. Not sure if that is the best way to do that.

Any suggestions would be appreciated.

Hi...

do it manually
onrowcommad get the articleid and then
use it to populate the from view....
even though its not that good... but for now it will save you...
Thanks. I think I got it working, but I'm not entirely sure what I did...

Now, I'm trying to do the same with a Bulleted List..

Jun 24 '07 #3

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

Similar topics

7
by: needin4mation | last post by:
I wanted easy tabs for my webpage and saw the new MultiView. I read and couldn't tell, but is the MultiView the same as having tabs? Or does MultiView bring everything at once and the user just...
0
by: Fabuloussites | last post by:
I have a page that has multiview control that has two dropdown lists on it. the dropdown controls ARE NOT inside of the multiview. Each drop down is bound using its own sqldatasource conrtol. The...
0
by: eric.olstad | last post by:
I want to create a web site that can dynamically creates tabs -- like firefox functionality built into a web site. Take a look at this site to get an idea of what I'm looking to do:...
0
by: Avon | last post by:
Hi friends, I am very sorry for my not perfect English. I have one question, I am using David Bauer's DynamicControlsPlaceholder to dinamically generate controls and I am tryig to generate...
4
by: TMT32 | last post by:
Hi, I try to add multiview in datalist, but how to change multiview's default view page in datalist? Where it is ? datalist1.itemtemplates.itemtemplates.multiview ?? thanks TMT32
2
by: Alexander van Doormalen | last post by:
I have a MultiView control with 2 Views in it. In the first View I have a form which contains sereral input controls and a custom UserControl. In this custom UserControl I have a button which...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
1
by: Nathan Sokalski | last post by:
When I include a MultiView control in my application, I receive the following error: MultiView cannot have children of type 'Label'. It can only have children of type View. I receive the...
0
by: James Crosswell | last post by:
I noticed something interesting when using the Multiview control and was wondering if someone could shed some light on the inner workings of all of this so I can better understand what's going on...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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...
0
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...
0
agi2029
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,...

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.