Skip to content

Commit 82c2d06

Browse files
DevExpressExampleBotDevExpressExampleBot
authored andcommitted
Source auto update [skip ci]
1 parent d031843 commit 82c2d06

File tree

5 files changed

+265
-0
lines changed

5 files changed

+265
-0
lines changed

VB/App_Data/nwind.mdb

1.1 MB
Binary file not shown.

VB/Default.aspx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
2+
3+
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
4+
Namespace="DevExpress.Web" TagPrefix="dx" %>
5+
6+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7+
<html xmlns="http://www.w3.org/1999/xhtml">
8+
<head runat="server">
9+
<title>How to hide the detail button if the detail grid is empty</title>
10+
</head>
11+
<body>
12+
<form id="form1" runat="server">
13+
<div>
14+
<br />
15+
<br />
16+
</div>
17+
<dx:ASPxGridView ID="mainGrid" runat="server" AutoGenerateColumns="False" DataSourceID="masterDataSource"
18+
KeyFieldName="CategoryID" OnDataBinding="masterGrid_DataBinding" OnDetailRowGetButtonVisibility="masterGrid_DetailRowGetButtonVisibility">
19+
<Templates>
20+
<DetailRow>
21+
<dx:ASPxGridView ID="detailGrid" runat="server" AutoGenerateColumns="False" DataSourceID="dsDetail"
22+
KeyFieldName="ProductID" OnBeforePerformDataSelect="detailGrid_BeforePerformDataSelect"
23+
Width="100%">
24+
<Styles>
25+
<DetailRow HorizontalAlign="Justify">
26+
</DetailRow>
27+
</Styles>
28+
<Columns>
29+
<dx:GridViewDataTextColumn FieldName="ProductID" ReadOnly="True" VisibleIndex="0">
30+
<EditFormSettings Visible="False" />
31+
</dx:GridViewDataTextColumn>
32+
<dx:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="1">
33+
</dx:GridViewDataTextColumn>
34+
<dx:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="2">
35+
</dx:GridViewDataTextColumn>
36+
</Columns>
37+
</dx:ASPxGridView>
38+
</DetailRow>
39+
</Templates>
40+
<Columns>
41+
<dx:GridViewDataTextColumn FieldName="CategoryID" ReadOnly="True" VisibleIndex="0">
42+
<EditFormSettings Visible="False" />
43+
</dx:GridViewDataTextColumn>
44+
<dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1">
45+
</dx:GridViewDataTextColumn>
46+
<dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="2">
47+
</dx:GridViewDataTextColumn>
48+
</Columns>
49+
<SettingsDetail ShowDetailRow="True" />
50+
</dx:ASPxGridView>
51+
<asp:AccessDataSource ID="dsDetail" runat="server" DataFile="~/App_Data/nwind.mdb"
52+
SelectCommand="SELECT [ProductID], [ProductName], [CategoryID], [UnitPrice] FROM [Products] WHERE ([CategoryID] = ?)">
53+
<SelectParameters>
54+
<asp:SessionParameter DefaultValue="CategoryID" Name="CategoryID" SessionField="CategoryID"
55+
Type="Int32" />
56+
</SelectParameters>
57+
</asp:AccessDataSource>
58+
<asp:AccessDataSource ID="masterDataSource" runat="server" DataFile="~/App_Data/nwind.mdb"
59+
SelectCommand="SELECT * FROM [Categories]"></asp:AccessDataSource>
60+
</form>
61+
</body>
62+
</html>

VB/Default.aspx.vb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Imports System
2+
Imports System.Collections.Generic
3+
Imports System.Linq
4+
Imports System.Web
5+
Imports System.Web.UI
6+
Imports System.Web.UI.WebControls
7+
Imports DevExpress.Web
8+
Imports DevExpress.Web.Data
9+
Imports System.Drawing
10+
Imports System.Collections
11+
Imports System.Data
12+
13+
Partial Public Class _Default
14+
Inherits System.Web.UI.Page
15+
16+
Protected Sub masterGrid_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
17+
DoSelect(masterDataSource.DataFile)
18+
End Sub
19+
Private Sub DoSelect(ByVal connectionString As String)
20+
Dim selectResult As New DataView()
21+
Dim selectCommand As String = "select distinct [CategoryID] from [Products]"
22+
Using ds As New AccessDataSource(connectionString, selectCommand)
23+
selectResult = CType(ds.Select(DataSourceSelectArguments.Empty), DataView)
24+
End Using
25+
Dim result As New ArrayList()
26+
For Each row As DataRow In selectResult.Table.Rows
27+
result.Add(row("CategoryID"))
28+
Next row
29+
Session("SelectResult") = result
30+
End Sub
31+
Protected Sub masterGrid_DetailRowGetButtonVisibility(ByVal sender As Object, ByVal e As ASPxGridViewDetailRowButtonEventArgs)
32+
If Not CType(Session("SelectResult"), ArrayList).Contains(e.KeyValue) Then
33+
e.ButtonState = GridViewDetailRowButtonState.Hidden
34+
End If
35+
End Sub
36+
Protected Sub detailGrid_BeforePerformDataSelect(ByVal sender As Object, ByVal e As EventArgs)
37+
Session("CategoryID") = (TryCast(sender, ASPxGridView)).GetMasterRowKeyValue()
38+
End Sub
39+
End Class

VB/Solution.sln

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Microsoft Visual Studio Solution File, Format Version 11.00
2+
# Visual Studio 2010
3+
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite", ".", "{E7100136-FDA4-46DF-B114-8F6ECC7C2DF8}"
4+
ProjectSection(WebsiteProperties) = preProject
5+
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
6+
Debug.AspNetCompiler.VirtualPath = "/WebSite"
7+
Debug.AspNetCompiler.PhysicalPath = "."
8+
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite\"
9+
Debug.AspNetCompiler.Updateable = "true"
10+
Debug.AspNetCompiler.ForceOverwrite = "true"
11+
Debug.AspNetCompiler.FixedNames = "false"
12+
Debug.AspNetCompiler.Debug = "True"
13+
Release.AspNetCompiler.VirtualPath = "/WebSite"
14+
Release.AspNetCompiler.PhysicalPath = "."
15+
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite\"
16+
Release.AspNetCompiler.Updateable = "true"
17+
Release.AspNetCompiler.ForceOverwrite = "true"
18+
Release.AspNetCompiler.FixedNames = "false"
19+
Release.AspNetCompiler.Debug = "False"
20+
VWDPort = "2101"
21+
EndProjectSection
22+
EndProject
23+
Global
24+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
25+
Debug|.NET = Debug|.NET
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{E7100136-FDA4-46DF-B114-8F6ECC7C2DF8}.Debug|.NET.ActiveCfg = Debug|.NET
29+
{E7100136-FDA4-46DF-B114-8F6ECC7C2DF8}.Debug|.NET.Build.0 = Debug|.NET
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
EndGlobal

VB/web.config

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Note: As an alternative to hand editing this file you can use the
4+
web admin tool to configure settings for your application. Use
5+
the Website->Asp.Net Configuration option in Visual Studio.
6+
A full list of settings and comments can be found in
7+
machine.config.comments usually located in
8+
\Windows\Microsoft.Net\Framework\v2.x\Config
9+
-->
10+
<configuration>
11+
<configSections>
12+
<sectionGroup name="devExpress">
13+
<section name="compression" type="DevExpress.Web.CompressionConfigurationSection, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
14+
<section name="themes" type="DevExpress.Web.ThemesConfigurationSection, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
15+
<section name="errors" type="DevExpress.Web.ErrorsConfigurationSection, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false" />
16+
</sectionGroup>
17+
</configSections>
18+
<appSettings />
19+
<connectionStrings />
20+
<system.web>
21+
<!--
22+
Set compilation debug="true" to insert debugging
23+
symbols into the compiled page. Because this
24+
affects performance, set this value to true only
25+
during development.
26+
-->
27+
<compilation targetFramework="4.0" debug="true">
28+
<assemblies>
29+
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
30+
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
31+
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
32+
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
33+
<add assembly="DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
34+
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
35+
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
36+
<add assembly="DevExpress.Printing.v13.1.Core, Version=13.1.14.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
37+
<add assembly="DevExpress.Data.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
38+
<add assembly="DevExpress.RichEdit.v13.1.Core, Version=13.1.14.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
39+
<add assembly="DevExpress.Docs.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
40+
</assemblies>
41+
</compilation>
42+
<!--
43+
The <authentication> section enables configuration
44+
of the security authentication mode used by
45+
ASP.NET to identify an incoming user.
46+
-->
47+
<authentication mode="Windows" />
48+
<!--
49+
The <customErrors> section enables configuration
50+
of what to do if/when an unhandled error occurs
51+
during the execution of a request. Specifically,
52+
it enables developers to configure html error pages
53+
to be displayed in place of a error stack trace.
54+
55+
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
56+
<error statusCode="403" redirect="NoAccess.htm" />
57+
<error statusCode="404" redirect="FileNotFound.htm" />
58+
</customErrors>
59+
-->
60+
<pages>
61+
<controls>
62+
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
63+
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
64+
</controls>
65+
</pages>
66+
<httpHandlers>
67+
<remove verb="*" path="*.asmx" />
68+
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
69+
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
70+
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
71+
<add verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" type="DevExpress.Web.ASPxUploadProgressHttpHandler, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
72+
</httpHandlers>
73+
<httpModules>
74+
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
75+
<add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
76+
</httpModules>
77+
</system.web>
78+
<system.codedom>
79+
<compilers>
80+
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
81+
<providerOption name="CompilerVersion" value="v4.0" />
82+
<providerOption name="WarnAsError" value="false" />
83+
</compiler>
84+
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
85+
<providerOption name="CompilerVersion" value="v4.0" />
86+
<providerOption name="OptionInfer" value="true" />
87+
<providerOption name="WarnAsError" value="false" />
88+
</compiler>
89+
</compilers>
90+
</system.codedom>
91+
<!--
92+
The system.webServer section is required for running ASP.NET AJAX under Internet
93+
Information Services 7.0. It is not necessary for previous version of IIS.
94+
-->
95+
<system.webServer>
96+
<validation validateIntegratedModeConfiguration="false" />
97+
<modules>
98+
<remove name="ScriptModule" />
99+
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
100+
<add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
101+
</modules>
102+
<handlers>
103+
<remove name="WebServiceHandlerFactory-Integrated" />
104+
<remove name="ScriptHandlerFactory" />
105+
<remove name="ScriptHandlerFactoryAppServices" />
106+
<remove name="ScriptResource" />
107+
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
108+
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
109+
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
110+
<add name="ASPxUploadProgressHandler" preCondition="integratedMode" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" type="DevExpress.Web.ASPxUploadProgressHttpHandler, DevExpress.Web.v13.1, Version=13.1.14.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
111+
</handlers>
112+
</system.webServer>
113+
<runtime>
114+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
115+
<dependentAssembly>
116+
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
117+
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
118+
</dependentAssembly>
119+
<dependentAssembly>
120+
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
121+
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
122+
</dependentAssembly>
123+
</assemblyBinding>
124+
</runtime>
125+
<devExpress>
126+
<compression enableHtmlCompression="false" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="false" />
127+
<themes enableThemesAssembly="true" />
128+
<errors callbackErrorRedirectUrl="" />
129+
</devExpress>
130+
</configuration>

0 commit comments

Comments
 (0)