Skip to main content
Inspiring
January 23, 2007
Question

ASP.NET Gridview example

  • January 23, 2007
  • 4 replies
  • 854 views
Still a ASP.NET newbie I'm afraid. Could anyone here help with the example
on
http://quickstarts.asp.net/QuickStartv20/aspnet/samples/data/GridViewDropDownList_vb.aspx
source at
http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/GridViewDropDownList.src

What changes would I have to make to initially make all states appear in the
gridview? Basically I want to add an All option at the top of the drop down
and have that selected initially.

Thanks for any tips.


This topic has been closed for replies.

4 replies

Inspiring
January 26, 2007
Incase somebody on google groups ever looks this up I did it this way.

I used the VB Show All Values on Null Selection example on

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/advanced.aspx

To make it work with MS Access I had to make some modifications

WHERE (state = iif(isnull(?), state, ?))

<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1"
PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="DropDownList1" Name="state"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>


Inspiring
January 24, 2007
If you are using MsAccess then you need to change from a SQLDataSource
control to an AccessDateSource control.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Bob" <no@mail.com> wrote in message
news:ep8a21$m11$1@forums.macromedia.com...
> Paul Whitham AdobeCommunityExpert wrote:
>> Bob
>>
>> There is a series of data tutorials on www.asp.net that you may find
>> useful. They use visual web developer (which is free) as to the tool
>> but show how to set initial value or a gridview bound to a dropdown.
>>
>> The problem with trying to modify the code you have shown is that the
>> SQLDataSource control has some limitations and when tyring to do
>> things like add default items in dropdowns it is often easier to
>> handle the whole process using ADO code rather than it.
>
> Thanks for your reply. I found this example that does what I want
>
> http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/DropDownListAll.srcOnlything
> is that I use access so I'm not sure what to do about theIsNull(@state,
> state).ISNull seems to work some different way with msaccess.
>


Inspiring
January 24, 2007
Paul Whitham AdobeCommunityExpert wrote:
> Bob
>
> There is a series of data tutorials on www.asp.net that you may find
> useful. They use visual web developer (which is free) as to the tool
> but show how to set initial value or a gridview bound to a dropdown.
>
> The problem with trying to modify the code you have shown is that the
> SQLDataSource control has some limitations and when tyring to do
> things like add default items in dropdowns it is often easier to
> handle the whole process using ADO code rather than it.

Thanks for your reply. I found this example that does what I want

http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/DropDownListAll.srcOnlything is that I use access so I'm not sure what to do about theIsNull(@state, state).ISNull seems to work some different way with msaccess.

Inspiring
January 24, 2007
Bob

There is a series of data tutorials on www.asp.net that you may find useful.
They use visual web developer (which is free) as to the tool but show how to
set initial value or a gridview bound to a dropdown.

The problem with trying to modify the code you have shown is that the
SQLDataSource control has some limitations and when tyring to do things like
add default items in dropdowns it is often easier to handle the whole
process using ADO code rather than it.


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Bob" <no@mail.com> wrote in message
news:ep5678$qa7$1@forums.macromedia.com...
> Still a ASP.NET newbie I'm afraid. Could anyone here help with the example
> on
> http://quickstarts.asp.net/QuickStartv20/aspnet/samples/data/GridViewDropDownList_vb.aspx
> source at
> http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/GridViewDropDownList.src
>
> What changes would I have to make to initially make all states appear in
> the gridview? Basically I want to add an All option at the top of the drop
> down and have that selected initially.
>
> Thanks for any tips.
>
>