Folks,
I have a nested GridTableView (DataSourceId: SqlDataSource2) in my RadGrid. In GridTableView I have a RadComboBox (SqlDatasourceId: SqlDataSource3). I would like to check for Duplicates if that Location is already exists for that person (i.e. Do not allow Duplicate entries for Update/Inserts). Below is my complete code as well as SqlDataSource2_Updating event (Is there any other event that can do the same also?).
Any Help will be appreciated. Thanks
GC_0620
_________________
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True"
AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" GridLines="None"
Skin="Office2007" PageSize="8" EnableLinqExpressions="False"
OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand = "RadGrid1_UpdateCommand"
>
<MasterTableView datakeynames="UserTablePrimaryKey" datasourceid="SqlDataSource1" AllowFilteringByColumn = "true" CommandItemDisplay="TopAndBottom">
<DetailTables>
<telerik:GridTableView runat="server" DataSourceID="SqlDataSource2" DataKeyNames="UserLocationsPrimaryKey"
Width="100%" Skin="WebBlue" CommandItemDisplay="Top" Name = "JobPerson" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="UserTableForeignKey" MasterKeyField="UserTablePrimaryKey" />
</ParentTableRelation>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<CommandItemTemplate>
<div style="padding: 5px 5px;">
Custom command item template
<asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" /> Edit selected</asp:LinkButton>
<asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" /> Update</asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" /> Cancel editing</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" /> Add new</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" /> Add this Location</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected Person?')"
runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" /> Delete selected Location</asp:LinkButton>
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" /> Refresh list</asp:LinkButton>
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField="UserLocationsPrimaryKey"
DataType="System.Int32" HeaderText="UserLocationsPrimaryKey" ReadOnly="True"
SortExpression="UserLocationsPrimaryKey" UniqueName="UserLocationsPrimaryKey"
Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="Location" DataType="System.Double"
HeaderText="Location" SortExpression="Location" UniqueName="Location">
<ItemTemplate>
<asp:Label ID="LocationLabel" runat="server" Text='<%# Eval("Location") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Program" HeaderText="Program"
SortExpression="Program" UniqueName="Program" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UserTableForeignKey"
DataType="System.Int32" HeaderText="UserTableForeignKey"
SortExpression="UserTableForeignKey" UniqueName="UserTableForeignKey"
Display="False" ReadOnly="True" Visible="False">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table id="Table1a" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse; background: white;">
<tr class="EditFormHeader">
<td colspan="2" style="font-size:small; z-index:0; font-family:Bookman Old Style; color:#669999">
<b>User Location</b></td>
</tr>
<tr>
<td></td>
</tr> <tr>
<td>
</td>
<tr>
<td>
Location</td>
<td>
<telerik:RadComboBox ID="RadComboBoxLocation" runat="server"
DataSourceID="SqlDataSource3" DataTextField="Program" DataValueField="Location"
DropDownWidth="369px" Height="150px" HighlightTemplatedItems="true"
MarkFirstMatch="true"
SelectedValue='<%#Bind("Location") %>' Skin="Office2007" Width="320px"
>
<HeaderTemplate>
<table cellpadding="0" cellspacing="0" style="width: 345px">
<tr>
<td style="width: 245px;">
Program</td>
<td style="width: 55px;">
Location</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" style="width: 345px">
<tr>
<td style="width: 245px;">
<%# DataBinder.Eval(Container.DataItem, "Program") %>
</td>
<td style="width: 55px;">
<%# DataBinder.Eval(Container.DataItem, "Location") %>
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="RadComboBoxLocationRequiredFieldValidator"
runat="server" ControlToValidate="RadComboBoxLocation"
ErrorMessage="! Required">
</asp:RequiredFieldValidator>
</td>
<td>
Program</td>
<td>
<asp:TextBox ID="TxtProgram" runat="server" TabIndex="2" ReadOnly="true"
Text='<%# Eval( "Program") %>' Width="250px">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td align="right" colspan="2">
<asp:Button ID="btnUpdate" runat="server"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
/>
<asp:Button ID="btnCancel" runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</td>
</tr>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
<!-- Rest of Master Table Continues -->
<Columns>
'
'
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
'
'
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
'
'
</ClientSettings>
</telerik:RadGrid>
<asp:Label ID="Msglabel" runat="server" Text="Label4"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:HR_Payroll_AuthorizationConnectionString %>"
DeleteCommand="DELETE FROM [UserLocations] WHERE [UserLocationsPrimaryKey] = @UserLocationsPrimaryKey"
InsertCommand="INSERT INTO [UserLocations] ([Location], [Program], [UserTableForeignKey]) VALUES (@Location, @Program, @UserTableForeignKey)"
SelectCommand="SELECT [UserLocationsPrimaryKey], [Location], [Program], [UserTableForeignKey] FROM [UserLocations] WHERE ([UserTableForeignKey] = @UserTableForeignKey) ORDER BY [Program]"
UpdateCommand="UPDATE [UserLocations] SET [Location] = @Location, [Program] = @Program, [UserTableForeignKey] = @UserTableForeignKey WHERE [UserLocationsPrimaryKey] = @UserLocationsPrimaryKey" onupdating="SqlDataSource2_Updating"
>
<SelectParameters>
<asp:Parameter Name="UserTableForeignKey" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="UserLocationsPrimaryKey" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Location" Type="Double" />
<asp:Parameter Name="Program" Type="String" />
<asp:Parameter Name="UserTableForeignKey" Type="Int32" />
<asp:Parameter Name="UserLocationsPrimaryKey" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Location" Type="Double" />
<asp:Parameter Name="Program" Type="String" />
<asp:Parameter Name="UserTableForeignKey" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:HR_Payroll_AuthorizationConnectionString %>"
SelectCommand="SELECT * FROM [CCNS_All_Location_Codes] WHERE ([Location] IS NOT NULL) ORDER BY [Program]">
</asp:SqlDataSource>
________________________________________________________ 
So Far I came up with this for Duplicate Checking but is not working. Any help will be appreciated..
protected void SqlDataSource2_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
RadComboBox combo = (RadComboBox)RadGrid1.MasterTableView.FindControl("RadComboBoxLocation");
//RadComboBox combo1 = (RadComboBox)RadGrid1.MasterTableView.Items[0].FindControl("RadComboBoxLocation");
//string strSelectedItem = combo1.SelectedItem.Text.ToString();
SqlConnection conLocation = new SqlConnection(ConfigurationManager.
ConnectionStrings["HR_Payroll_AuthorizationConnectionString"].ToString());
SqlCommand cmd = new SqlCommand("SELECT Count(*) FROM UserLocations " +
"WHERE ([Location] = '" + combo.SelectedValue.ToString() + "'", conLocation);
conLocation.Open();
Object result = cmd.ExecuteScalar();
if (result != null)
{
Msglabel.Visible = true;
Msglabel.Text = "Duplicate Location for this Person - Can't proceed.."
e.Cancel = true;
}
conLocation.Close();
}
<
telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal"
Width="1000px" BorderSize="0" Skin="WebBlue">
<telerik:RadPane ID="RadPane1" Runat="server" Width="1000px" Height="37px"><asp:Table ID="Table2" runat="server" Width="995px" CellPadding="0" CellSpacing="0" Height="37px">
<asp:TableRow >
<asp:TableCell Font-Names="Freestyle Script" Font-Size="XX-Large" ForeColor="#3F3F3F" Width="3%"></asp:TableCell>
<asp:TableCell Font-Names="Freestyle Script" Font-Size="XX-Large" ForeColor="#666666" Width="72%">(Portal)</asp:TableCell>
<asp:TableCell Font-Names="Arial" Font-Overline="False" Font-Size="Small" ForeColor="#24E6D6" Font-Underline="True" Width="10%">Welcome:</asp:TableCell>
<asp:TableCell ForeColor="#2A7CC1" Font-Names="Arial" Font-Size="Small" Width="15%"></asp:TableCell>
</asp:TableRow>
</asp:Table>
</telerik:RadPane>
<telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" />
<telerik:RadPane ID="RadPane2" runat="server" Width="1000px" Height="493px">
<telerik:RadSplitter ID="RadSplitter2" runat="server" Height="100%"
Width="100%">
<telerik:RadPane ID="RadPane3" runat="server">
</telerik:RadPane>
<telerik:RadSplitBar ID="RadSplitBar2" runat="server" />
<telerik:RadPane ID="RadPane4" runat="server">
</telerik:RadPane>
</telerik:RadSplitter>
</telerik:RadPane>
</telerik:RadSplitter>
with this setup I get scrollbars on the right and botom of what I think is the bottom horizontal panel of the first splitter. I would like a clean join onto the side of the splitter border.
I hope this is a quick one, Thanks in advance for your time and help
mike
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
| <contentTemplate> |
| <asp:Button ID="btnAddToList" runat="server" Text="Add to list" |
| Visible="False" /> |
| <asp:Button ID="btnClearList" runat="server" Text="Clear List" |
| Visible="False" /> |
| <table width="100%"> |
| <tr> |
| <td valign="top" width="25%"> |
| <asp:RadioButtonList ID="rbnPickDetails" runat="server" AutoPostBack="True"> |
| </asp:RadioButtonList> |
| <asp:Label ID="lblSelectFromRadio" runat="server" Text="Select the contact you wish to merge all other contacts with and then click on 'Merge Contacts' button to proceed. " visible="false"></asp:Label> |
| </td> |
| <td valign="top" width="75%"> |
| <asp:Label ID="lblContactDetails" runat="server"></asp:Label> |
| <br /> |
| <asp:Button ID="btnViewContactDetails" runat="server" |
| Text="View Contact Details" Visible="False" /> |
| <asp:Button ID="btnMergeContacts" runat="server" Text="Merge Contacts" |
| Visible="False" /> |
| <br /> |
| <asp:Label ID="lblWarning" runat="server" ForeColor="Red" |
| Text="You must select more than one contact to be able to merge." |
| Visible="False"></asp:Label> |
| </td> |
| </tr> |
| </table> |
| </contentTemplate> |
| <triggers> |
| <asp:AsyncPostBackTrigger ControlID="rbnPickDetails" EventName="SelectedIndexChanged" /> |
| </triggers> |
| </asp:UpdatePanel> |
| Protected Sub btnAddToList_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddToList.Click |
| For Each row As GridDataItem In uwgDuplicates.MasterTableView.Items |
| If row.Selected Then |
| If rbnContactType.SelectedValue = "investigators" Then |
| If IsNothing(rbnPickDetails.Items.FindByValue(row.Item("PersonnelID").Text)) Then |
| rbnPickDetails.Items.Add(New ListItem(row.Item("ContactName").Text, row.Item("PersonnelID").Text)) |
| End If |
| ElseIf rbnContactType.SelectedValue = "funders" Then |
| If IsNothing(rbnPickDetails.Items.FindByValue(row.Item("ContactID").Text)) Then |
| rbnPickDetails.Items.Add(New ListItem(row.Item("ContactName").Text, row.Item("ContactID").Text)) |
| End If |
| End If |
| End If |
| Next |
| If rbnPickDetails.Items.Count > 1 Then |
| lblWarning.Visible = False |
| Else |
| lblWarning.Visible = True |
| End If |
| lblSelectFromRadio.Visible = True |
| End Sub |
| <httpHandlers> |
| <remove verb="*" path="*.asmx"/> |
| <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> |
| <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"/> |
| <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"/> |
| <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> |
| </httpHandlers> |
| <telerik:RadSplitter ID="rsRightNav" Runat="server" Orientation="Horizontal"> |
| <telerik:RadPane ID="rpTop" runat="server" MinHeight="100" MinWidth="100"> |
| <telerik:RadSplitter ID="RadSplitter1" Runat="server" Orientation="Vertical"> |
| <telerik:RadPane ID="rpTop_Content" runat="server" Scrolling="None" Width="100%"> |
| <telerik:RadSlidingZone ID="rszTop" Runat="server" > |
| <telerik:RadSlidingPane ID="rsp1" runat="server" Title="Pane1" EnableDock="true">Content of Pane1</telerik:RadSlidingPane> |
| <telerik:RadSlidingPane ID="rsp2" runat="server" Title="Pane2" EnableDock="true">Content of Pane2</telerik:RadSlidingPane> |
| <!-- Dynamically added RadSlidingPanes --> |
| </telerik:RadSlidingZone> |
| </telerik:RadPane> |
| <telerik:RadSplitBar ID="rpTop_Content_rsb1" runat="server" /> |
| </telerik:RadSplitter> |
| </telerik:RadPane> |
| <telerik:RadSplitBar ID="rsb1" runat="server" CollapseMode="Both" /> |
| <telerik:RadPane ID="rpBot" runat="server" MinHeight="100" MinWidth="100"> |
| <telerik:RadSlidingZone ID="rszBot" Runat="server"> |
| </telerik:RadSlidingZone> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource3" |
| DefaultType="Line" Skin="DeepBlue" Width="750px" Height="225px" |
| AutoLayout="True" EnableTheming="True"> |
| <Series> |
| <telerik:ChartSeries Name="Reported Result" |
| DataYColumn="Reported Result" Type="Line" > |
| <Appearance> |
| <FillStyle MainColor="213, 247, 255" FillType="ComplexGradient"> |
| <FillSettings> |
| <ComplexGradient> |
| <telerik:GradientElement Color="213, 247, 255" /> |
| <telerik:GradientElement Color="193, 239, 252" Position="0.5" /> |
| <telerik:GradientElement Color="157, 217, 238" Position="1" /> |
| </ComplexGradient> |
| </FillSettings> |
| </FillStyle> |
| <TextAppearance TextProperties-Color="White"> |
| </TextAppearance> |
| </Appearance> |
| </telerik:ChartSeries> |
| </Series> |
| <PlotArea> |
| <XAxis AutoScale="False" DataLabelsColumn="collectdate" MaxValue="7" |
| MinValue="1" Step="1" IsZeroBased="true"> |
| <Appearance TextAppearance-TextProperties-Font="Arial, 8.25pt, style=Bold" |
| Color="98, 183, 226" MajorTick-Color="98, 183, 226"> |
| <MajorGridLines Color="98, 183, 226" Width="0" Visible="false"/> |
| <TextAppearance TextProperties-Color="White"> |
| </TextAppearance> |
| </Appearance> |
| <AxisLabel> |
| <Appearance Dimensions-Paddings="1px, 1px, 10%, 1px"> |
| </Appearance> |
| <TextBlock> |
| <Appearance TextProperties-Color="LightSkyBlue"> |
| </Appearance> |
| </TextBlock> |
| </AxisLabel> |
| <Items> |
| <telerik:ChartAxisItem Value="1"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="2"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="3"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="4"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="5"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="6"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| <telerik:ChartAxisItem Value="7"> |
| <TextBlock Text="abc"> |
| <Appearance TextProperties-Font="Arial, 8.25pt, style=Bold"> |
| </Appearance> |
| </TextBlock> |
| </telerik:ChartAxisItem> |
| </Items> |
| </XAxis> |
| <YAxis AutoScale="false"> |
| <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226" |
| MinorTick-Color="98, 183, 226"> |
| <MajorGridLines Color="120, 209, 248" /> |
| <MinorGridLines Color="120, 209, 248" Width="0" /> |
| <TextAppearance TextProperties-Color="White"> |
| </TextAppearance> |
| </Appearance> |
| <AxisLabel> |
| <TextBlock> |
| <Appearance TextProperties-Color="LightSkyBlue"> |
| </Appearance> |
| </TextBlock> |
| </AxisLabel> |
| </YAxis> |
| <Appearance Dimensions-Margins="19%, 90px, 12%, 9%"> |
| <FillStyle MainColor="50, 255, 255, 255" SecondColor="Transparent"> |
| </FillStyle> |
| <Border Color="97, 180, 223" /> |
| </Appearance> |
| </PlotArea> |
| <Appearance> |
| <FillStyle FillType="ComplexGradient"> |
| <FillSettings> |
| <ComplexGradient> |
| <telerik:GradientElement Color="26, 120, 179" /> |
| <telerik:GradientElement Color="35, 189, 254" Position="0.5" /> |
| <telerik:GradientElement Color="26, 120, 179" Position="1" /> |
| </ComplexGradient> |
| </FillSettings> |
| </FillStyle> |
| <Border Color="0, 66, 110" Width="5" /> |
| </Appearance> |
| <ChartTitle> |
| <Appearance Dimensions-Margins="4%, 10px, 14px, 6%"> |
| <FillStyle MainColor=""> |
| </FillStyle> |
| </Appearance> |
| <TextBlock Text=""> |
| <Appearance TextProperties-Font="Verdana, 14pt" TextProperties-Color="White"> |
| </Appearance> |
| </TextBlock> |
| </ChartTitle> |
| <Legend Visible="False"> |
| <Appearance Dimensions-Margins="1px, 2%, 12%, 1px" Visible="False"> |
| <ItemTextAppearance TextProperties-Color="White"> |
| </ItemTextAppearance> |
| <FillStyle GammaCorrection="False" MainColor="37, 255, 255, 255"> |
| </FillStyle> |
| <Border Color="76, 255, 255, 255" /> |
| </Appearance> |
| <TextBlock> |
| <Appearance Position-AlignedPosition="Top" TextProperties-Color="LightSkyBlue"> |
| </Appearance> |
| </TextBlock> |
| </Legend> |
| </telerik:RadChart> |
| Protected Sub RadChart1_BeforeLayout(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadChart1.BeforeLayout |
| Dim HiZone As Decimal |
| Dim LoZone As Decimal |
| ' Get Hi and Lo limits for result |
| HiZone = GetZoneHi(cboParam.SelectedValue, Request("EquipmentID"), Request("SampleNumber")) |
| LoZone = GetZoneLow(cboParam.SelectedValue, Request("EquipmentID"), Request("SampleNumber")) |
| RadChart1.Series(0).Appearance.PointMark.Dimensions.AutoSize = False |
| RadChart1.Series(0).Appearance.PointMark.Dimensions.Width = 8 |
| RadChart1.Series(0).Appearance.PointMark.Dimensions.Height = 8 |
| RadChart1.Series(0).Appearance.PointMark.FillStyle.MainColor = System.Drawing.Color.Black |
| RadChart1.Series(0).Appearance.PointMark.Visible = True |
| Dim markedzone As ChartMarkedZone = New ChartMarkedZone |
| markedzone.ValueStartY = LoZone |
| markedzone.ValueEndY = HiZone |
| markedzone.Appearance.FillStyle.MainColor = Drawing.Color.Gray |
| RadChart1.PlotArea.MarkedZones.Add(markedzone) |
| RadChart1.PlotArea.YAxis.MaxValue = (HiZone * 0.25) + HiZone ' *10 |
| RadChart1.PlotArea.YAxis.MinValue = -5 |
| RadChart1.PlotArea.YAxis.AutoScale = True |
| Dim markedzone2 As ChartMarkedZone = New ChartMarkedZone |
| markedzone2.ValueStartY = 0 |
| markedzone2.ValueEndY = LoZone |
| markedzone2.Appearance.FillStyle.MainColor = Drawing.Color.LightCoral |
| RadChart1.PlotArea.MarkedZones.Add(markedzone2) |
| Dim markedzone3 As ChartMarkedZone = New ChartMarkedZone |
| markedzone3.ValueStartY = HiZone |
| markedzone3.ValueEndY = HiZone + (HiZone * 0.25) |
| markedzone3.Appearance.FillStyle.MainColor = Drawing.Color.LightCoral |
| RadChart1.PlotArea.MarkedZones.Add(markedzone3) |
| RadChart1.Chart.Legend.Visible = False |
| RadChart1.AutoLayout = True |
| End Sub |
Hi.
I have a radgrid with a one detailtable, inside this detail, i have two radcombox, in the insert of the new row, i'm trying to populate the second radcombox with the value from the first radcombox using the event OnSelectedindexChanged, but i'm not getting find the control radcombobox, i'm using the code bellow , but i know that this code is wrong, because I know I need to get index of the line, but i don't how to get. Could you help-me?
sqlTarget.SelectCommand = "SELECT* FROM tb_tar_target where and mov_c_divisao = '" & CType(rdgWorkFlow.MasterTableView.DetailTables(0).FindControl("rdbnil_c_divisao"), RadComboBox).SelectedItem.Text
CType(rdgWorkFlow.MasterTableView.DetailTables(0).FindControl("rdbnil_tar_n_codigo"), RadComboBox).DataSource = sqlTarget
CType(rdgWorkFlow.MasterTableView.DetailTables(0).FindControl("rdbnil_tar_n_codigo"), RadComboBox).DataBind()
excuse-me by my english
thanks
Fabio