Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ASP.NET Gridview example

LEGEND ,
Jan 23, 2007 Jan 23, 2007
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/GridViewDropDo...

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.


TOPICS
Server side applications
847
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 23, 2007 Jan 23, 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/GridViewDropDo...
>
> 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.
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2007 Jan 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/DropDownListAl... 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2007 Jan 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/DropDownListAl...
> 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.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2007 Jan 26, 2007
LATEST
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>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines