Dear Friends,
I have an issue since a couple of days. I have RadGrid1 which has Edit functionality by PopUp Edit Mode. Inside the Edit Form Template, I have another grid - RadGrid2. Everything is working fine except one thing - In RadGrid1 I have Client Settings with Client Event - OnRowClick. The problem here is that these client settings are also automatically applied to RadGrid2 when working in Edit mode
Could you please provide me some solution for that.
10x,
Alex
I have an issue since a couple of days. I have RadGrid1 which has Edit functionality by PopUp Edit Mode. Inside the Edit Form Template, I have another grid - RadGrid2. Everything is working fine except one thing - In RadGrid1 I have Client Settings with Client Event - OnRowClick. The problem here is that these client settings are also automatically applied to RadGrid2 when working in Edit mode
Could you please provide me some solution for that.
10x,
Alex
8 Answers, 1 is accepted
0

Alex
Top achievements
Rank 2
answered on 01 Jul 2013, 11:02 AM
Does anybody know why radgrid2, which is inside the form template of radgrid1 has the same naming container as radgrid1 and how can I manage to fix that issue
0
Hello,
About your first question, could you share your full page source code along with the code-behind file? Thus all the people who want to help you will have better understanding of your scenario.
About your second question, RadGrid2 has GridEditFormItem for its NamingContainer. The NamingContainer of RadGrid1 depends on the control in which the RadGrid1 is located. Again. sharing your code would help to better understand your scenario.
Regards,
Andrey
Telerik
About your first question, could you share your full page source code along with the code-behind file? Thus all the people who want to help you will have better understanding of your scenario.
About your second question, RadGrid2 has GridEditFormItem for its NamingContainer. The NamingContainer of RadGrid1 depends on the control in which the RadGrid1 is located. Again. sharing your code would help to better understand your scenario.
Regards,
Andrey
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0

Alex
Top achievements
Rank 2
answered on 03 Jul 2013, 06:34 AM
I am applying my source code. As you can see my RadGrid1 has ClientEvents - OnRowClick. OnRowClick I am calling the function RowDblClick. The behavior for RadGrid3 (Inside the form template) is absolutely the same, which is not suppose to be. For that grid I don't have any client setting, even the row selection is set to false. What is wrong?
<
telerik:RadGrid
ID
=
"RadGrid1"
AllowPaging
=
"true"
PageSize
=
"20"
AllowSorting
=
"true"
AutoGenerateColumns
=
"false"
ShowStatusBar
=
"true"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"false"
AllowMultiRowEdit
=
"true"
Width
=
"99%"
AllowMultiRowSelection
=
"True"
runat
=
"server"
Gridlines
=
"None"
Skin
=
"Web20"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnItemCommand
=
"RadGrid1_ItemCommandClick"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
ClientDataKeyNames
=
"reception_id, reception_code, owner_id"
DataKeyNames
=
"reception_id"
EditMode
=
"PopUp"
>
<
CommandItemSettings
AddNewRecordText
=
"Нова"
/>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"reception_code"
SortExpression
=
"reception_code"
HeaderText
=
"Поръчка No"
DataField
=
"reception_code"
ItemStyle-HorizontalAlign
=
"Left"
><
HeaderStyle
Width
=
"10%"
/></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"source"
SortExpression
=
"source"
HeaderText
=
"Реф. No"
DataField
=
"source"
ItemStyle-HorizontalAlign
=
"Left"
><
HeaderStyle
Width
=
"10%"
/></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"sup_descr"
SortExpression
=
"sup_descr"
HeaderText
=
"Доставчик"
DataField
=
"sup_descr"
ItemStyle-HorizontalAlign
=
"Left"
><
HeaderStyle
Width
=
"25%"
/> </
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"owner_descr"
SortExpression
=
"owner_descr"
HeaderText
=
"Собственик"
DataField
=
"owner_descr"
><
HeaderStyle
Width
=
"20%"
/></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"expected_date"
SortExpression
=
"expected_date"
HeaderText
=
"Доставка"
DataField
=
"expected_date"
DataFormatString
=
"{0: dd.MM.yyyy}"
><
HeaderStyle
Width
=
"7%"
/></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"creator"
SortExpression
=
"creator"
HeaderText
=
"Създал"
DataField
=
"creator"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"is_active"
SortExpression
=
"is_active"
DataField
=
"is_active"
Visible
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"reception_status"
SortExpression
=
"reception_status"
DataField
=
"reception_status"
Visible
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"confirm"
HeaderStyle-Width
=
"6%"
Visible
=
"true"
HeaderText
=
"Активен"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"ImageButton1"
runat
=
"server"
ImageUrl
=
"Img/active.png"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"reception_id") %>' OnClientClick="ConfirmIB1(this); return false;" OnCommand="ImageBtn1_Click" Visible="false" />
<
asp:ImageButton
ID
=
"ImageButton2"
runat
=
"server"
ImageUrl
=
"Img/notactive.png"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"reception_id") %>' OnClientClick="ConfirmIB2(this); return false;" OnCommand="ImageBtn1_Click" Visible="false"/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"confirm"
HeaderStyle-Width
=
"8%"
Visible
=
"true"
HeaderText
=
"Валидиране"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"ImageButton3"
runat
=
"server"
ImageUrl
=
"Img/ok.PNG"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"reception_id") %>' Visible="true" />
<
asp:ImageButton
ID
=
"ImageButton4"
runat
=
"server"
ImageUrl
=
"Img/no.PNG"
CommandArgument='<%# DataBinder.Eval(Container.DataItem,"reception_id") %>' OnClientClick="ConfirmIB4(this); return false;" OnCommand="ImageBtn4_Click" Visible="true" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
HeaderStyle-Width
=
"5%"
ButtonType
=
"ImageButton"
></
telerik:GridEditCommandColumn
>
</
Columns
>
<
EditFormSettings
InsertCaption
=
"Добавяне на нова"
CaptionFormatString
=
"Промяна: {0}"
CaptionDataField
=
"reception_code"
EditFormType
=
"Template"
PopUpSettings-Modal
=
"false"
PopUpSettings-Width
=
"400px"
>
<
FormTemplate
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"RadTabStrip2"
SelectedIndex
=
"0"
MultiPageID
=
"RadMultiPage2"
Skin
=
"Web20"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"tab1"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"tab2"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"RadMultiPage2"
SelectedIndex
=
"0"
Height
=
"200px"
Width
=
"100%"
CssClass
=
"multiPage"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView5"
CssClass
=
"corporatePageView"
Width
=
"100%"
>
<
br
/>
<
table
id
=
"Table1"
cellspacing
=
"1"
cellpadding
=
"1"
width
=
"380"
border
=
"0"
style
=
"text-align:right"
>
<
tr
>
<
td
>
test1:
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadTextBox
ID
=
"TextBox10"
runat
=
"server"
Width
=
"150px"
Text='<%# Bind( "source") %>' Skin="Web20"></
telerik:RadTextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
test2:
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadComboBox
ID
=
"RCB1"
runat
=
"server"
Filter
=
"Contains"
Skin
=
"Web20"
Width
=
"250px"
></
telerik:RadComboBox
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text='<%# Bind( "supplier_id") %>' Visible="false"></
asp:Label
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator5"
runat
=
"server"
ErrorMessage
=
"*"
ForeColor
=
"Red"
ControlToValidate
=
"RCB1"
InitialValue
=
""
ValidationGroup
=
"validate"
></
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
>
test3:
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadComboBox
ID
=
"RCB2"
runat
=
"server"
Filter
=
"Contains"
Skin
=
"Web20"
Width
=
"250px"
></
telerik:RadComboBox
>
<
asp:Label
ID
=
"Label3"
runat
=
"server"
Text='<%# Bind( "owner_id") %>' Visible="false"></
asp:Label
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ErrorMessage
=
"*"
ForeColor
=
"Red"
ControlToValidate
=
"RCB2"
InitialValue
=
""
ValidationGroup
=
"validate"
></
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
>
test4:
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadDatePicker
ID
=
"RadDatePicker1"
runat
=
"server"
DateInput-EmptyMessage
=
"дд.мм.гггг"
ShowPopupOnFocus
=
"true"
Culture
=
"bg-BG"
Skin
=
"WebBlue"
Width
=
"155px"
DbSelectedDate='<%# Bind( "EXPECTED_DATE") %>' >
<
Calendar
ID
=
"Calendar4"
runat
=
"server"
>
<
SpecialDays
>
<
telerik:RadCalendarDay
Repeatable
=
"Today"
ItemStyle-CssClass
=
"rcToday"
/>
</
SpecialDays
>
</
Calendar
>
</
telerik:RadDatePicker
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator3"
runat
=
"server"
ErrorMessage
=
"*"
ForeColor
=
"Red"
ControlToValidate
=
"RadDatePicker1"
InitialValue
=
""
ValidationGroup
=
"validate"
></
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
</
table
>
<
br
/>
<
table
style
=
"width: 100%"
>
<
tr
>
<
td
align
=
"right"
colspan
=
"2"
width
=
"100%"
>
<
telerik:RadButton
ID
=
"Button1"
Skin
=
"Web20"
Text='<%# (Container is GridEditFormInsertItem) ? "Запис" : "Промяна" %>'
runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ValidationGroup="validate" >
<
Icon
PrimaryIconCssClass
=
"rbOk"
/>
</
telerik:RadButton
>
<
telerik:RadButton
ID
=
"Button2"
Skin
=
"Web20"
Text
=
"Отмяна"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
>
<
Icon
PrimaryIconCssClass
=
"rbCancel"
/>
</
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView6"
CssClass
=
"corporatePageView"
Width
=
"100%"
>
<
br
/>
<
table
id
=
"Table2"
cellspacing
=
"1"
cellpadding
=
"1"
width
=
"400"
border
=
"0"
>
<
tr
>
<
td
>
test5:
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadTextBox
ID
=
"TextBox6"
runat
=
"server"
Text='<%# Bind( "AUX_TRANSPORT" ) %>'></
telerik:RadTextBox
>
</
td
>
<
td
></
td
>
</
tr
>
<
tr
>
<
td
>
test6
</
td
>
<
td
style
=
"text-align:left"
>
<
telerik:RadTextBox
ID
=
"RadTextBox8"
runat
=
"server"
></
telerik:RadTextBox
>
-
<
telerik:RadTextBox
ID
=
"RadTextBox9"
runat
=
"server"
Width
=
"60px"
></
telerik:RadTextBox
>
</
td
>
<
td
>
<
telerik:RadButton
ID
=
"RadButton3"
runat
=
"server"
Text
=
"Добави"
Skin
=
"WebBlue"
CommandName
=
"Add_CEVDP"
Visible="<%# (Container is GridEditFormInsertItem) ? false : true %>" >
<
Icon
PrimaryIconCssClass
=
"rbAdd"
PrimaryIconLeft
=
"4"
/>
</
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
<
telerik:RadGrid
ID
=
"RadGrid3"
Width
=
"99%"
AllowSorting
=
"False"
AllowPaging
=
"False"
AutoGenerateColumns
=
"false"
AllowMultiRowSelection
=
"false"
runat
=
"server"
Gridlines
=
"None"
Skin
=
"WebBlue"
ShowHeader
=
"false"
OnNeedDataSource
=
"RadGrid3_NeedDataSource"
>
<
HeaderContextMenu
EnableImageSprites
=
"True"
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
MasterTableView
TableLayout
=
"Auto"
DataKeyNames
=
"id"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"test6"
SortExpression
=
"test6"
DataField
=
"test6"
HeaderStyle-Width
=
"70px"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"test5"
SortExpression
=
"test5"
DataField
=
"test5"
HeaderStyle-Width
=
"70px"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
EnablePostBackOnRowClick
=
"false"
EnableRowHoverStyle
=
"false"
>
<
Selecting
AllowRowSelect
=
"false"
></
Selecting
>
</
ClientSettings
>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"120px"
/>
</
telerik:RadGrid
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
EnablePostBackOnRowClick
=
"true"
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
ClientEvents
OnRowClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"120px"
/>
</
telerik:RadGrid
>
</
fieldset
>
0

Alex
Top achievements
Rank 2
answered on 03 Jul 2013, 07:02 AM
Code Behind:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditFormItem && e.Item.IsInEditMode)
{
GridEditFormItem editedItem = e.Item
as
GridEditFormItem;
RadComboBox combo1 = (RadComboBox)editedItem.FindControl(
"RCB1"
);
RadComboBox combo2 = (RadComboBox)editedItem.FindControl(
"RCB2"
);
RadGrid RadGrid3 = (RadGrid)editedItem.FindControl(
"RadGrid3"
);
OracleConnection con =
new
OracleConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString10"
].ConnectionString);
try
{
OracleCommand sup =
new
OracleCommand(
"select * from log_supplier order by description"
, con);
OracleCommand own =
new
OracleCommand(
"select * from log_owner order by owner_code"
, con);
DataSet ds =
new
DataSet();
OracleDataAdapter da_sup =
new
OracleDataAdapter(sup);
OracleDataAdapter da_own =
new
OracleDataAdapter(own);
da_sup.Fill(ds,
"sup"
);
da_own.Fill(ds,
"own"
);
combo1.DataSource = ds.Tables[
"sup"
].DefaultView;
combo1.DataValueField =
"supplier_id"
;
combo1.DataTextField =
"description"
;
combo1.DataBind();
combo1.Items.Insert(0,
new
RadComboBoxItem(
""
,
"0"
));
combo1.SelectedValue = ((Label)editedItem.FindControl(
"label1"
)).Text;
combo2.DataSource = ds.Tables[
"own"
].DefaultView;
combo2.DataValueField =
"owner_id"
;
combo2.DataTextField =
"owner_code"
;
combo2.DataBind();
combo2.Items.Insert(0,
new
RadComboBoxItem(
""
,
"0"
));
combo2.SelectedValue = ((Label)editedItem.FindControl(
"label3"
)).Text;
}
catch
(Exception ex)
{
}
finally
{ }
}
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
ImageButton btn1 = (ImageButton)item.FindControl(
"ImageButton1"
);
//active
ImageButton btn2 = (ImageButton)item.FindControl(
"ImageButton2"
);
//not active
ImageButton btn3 = (ImageButton)item.FindControl(
"ImageButton3"
);
//active
ImageButton btn4 = (ImageButton)item.FindControl(
"ImageButton4"
);
//not active
if
(item[
"is_active"
].Text ==
"1"
)
{
btn1.Visible =
true
;
btn2.Visible =
false
;
}
else
{
btn1.Visible =
false
;
btn2.Visible =
true
;
}
if
(item[
"reception_status"
].Text ==
"1"
)
{
btn4.Visible =
true
;
btn3.Visible =
false
;
}
else
{
btn4.Visible =
false
;
btn3.Visible =
true
;
}
}
}
protected
void
RadGrid1_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
OracleConnection con =
new
OracleConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString10"
].ConnectionString);
try
{
OracleCommand com =
new
OracleCommand(
"receptions.search_pre"
);
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
com.Parameters.Add(
"p_rec_id"
, OracleDbType.Int32, 10).Value = DBNull.Value;
com.Parameters.Add(
"p_error_out"
, OracleDbType.Varchar2, 1000).Direction = ParameterDirection.Output;
com.Parameters.Add(
"info"
, OracleDbType.RefCursor).Direction = ParameterDirection.Output;
OracleDataAdapter da =
new
OracleDataAdapter(com);
DataSet ds =
new
DataSet();
da.Fill(ds);
RadGrid1.DataSource = ds.Tables[0].DefaultView;
}
catch
(Exception ex)
{
Response.Write(
"Script Error: "
+ ex.Message);
}
finally
{
}
}
protected
void
RadGrid1_ItemCommandClick(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName ==
"PerformInsert"
)
{
GridEditFormInsertItem insertform = (GridEditFormInsertItem)e.Item.OwnerTableView.GetInsertItem();
string
txtbox10 = ((RadTextBox)insertform.FindControl(
"TextBox10"
)).Text;
RadComboBox rcb1 = (RadComboBox)insertform.FindControl(
"RCB1"
);
RadComboBox rcb2 = (RadComboBox)insertform.FindControl(
"RCB2"
);
RadDatePicker rdp = (RadDatePicker)insertform.FindControl(
"RadDatePicker1"
);
string
txtbox8 = ((RadTextBox)insertform.FindControl(
"TextBox6"
)).Text;
try
{
OracleConnection con =
new
OracleConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString10"
].ConnectionString);
OracleCommand com =
new
OracleCommand(
"receptions.add_rec_header"
);
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
com.Parameters.Add(
"p_ref_no"
, OracleDbType.Varchar2, 100).Value = txtbox10;
com.Parameters.Add(
"p_sup_id"
, OracleDbType.Int32, 10).Value = Convert.ToInt32(rcb1.SelectedValue);
com.Parameters.Add(
"p_owner_id"
, OracleDbType.Int32, 10).Value = Convert.ToInt32(rcb2.SelectedValue);
com.Parameters.Add(
"p_exp_date"
, OracleDbType.Date, 10).Value = Convert.ToDateTime(rdp.SelectedDate.Value.ToString(), System.Globalization.CultureInfo.CreateSpecificCulture(
"en-GB"
).DateTimeFormat);
com.Parameters.Add(
"p_cust_doc"
, OracleDbType.Varchar2, 100).Value = txtbox8;
com.Parameters.Add(
"p_creator"
, OracleDbType.Int32, 10).Value = Session[
"UserID"
].ToString();
com.Parameters.Add(
"p_id_out"
, OracleDbType.Int32, 10).Direction = ParameterDirection.Output;
com.Parameters.Add(
"p_error_out"
, OracleDbType.Varchar2, 1000).Direction = ParameterDirection.Output;
con.Open();
com.ExecuteNonQuery();
con.Close();
if
(com.Parameters[
"p_error_out"
].Value.ToString() ==
"0"
)
{
RadGrid1.MasterTableView.IsItemInserted =
false
;
RadGrid1.Rebind();
}
else
{
}
}
catch
(Exception ex)
{
}
finally
{
}
}
if
(e.CommandName ==
"Update"
)
{
GridEditFormItem editform = (GridEditFormItem)e.Item;
string
txtbox10 = ((RadTextBox)editform.FindControl(
"TextBox10"
)).Text;
RadComboBox rcb1 = (RadComboBox)editform.FindControl(
"RCB1"
);
RadComboBox rcb2 = (RadComboBox)editform.FindControl(
"RCB2"
);
RadDatePicker rdp = (RadDatePicker)editform.FindControl(
"RadDatePicker1"
);
string
txtbox8 = ((RadTextBox)editform.FindControl(
"TextBox6"
)).Text;
try
{
OracleConnection con =
new
OracleConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString10"
].ConnectionString);
OracleCommand com =
new
OracleCommand(
"receptions.upd_rec_header"
);
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
com.Parameters.Add(
"p_id"
, OracleDbType.Int32, 10).Value = Convert.ToInt32(editform.GetDataKeyValue(
"reception_id"
));
com.Parameters.Add(
"p_ref_no"
, OracleDbType.Varchar2, 100).Value = txtbox10;
com.Parameters.Add(
"p_sup_id"
, OracleDbType.Int32, 10).Value = Convert.ToInt32(rcb1.SelectedValue);
com.Parameters.Add(
"p_owner_id"
, OracleDbType.Int32, 10).Value = Convert.ToInt32(rcb2.SelectedValue);
com.Parameters.Add(
"p_exp_date"
, OracleDbType.Date, 10).Value = Convert.ToDateTime(rdp.SelectedDate.Value.ToString(), System.Globalization.CultureInfo.CreateSpecificCulture(
"en-GB"
).DateTimeFormat);
com.Parameters.Add(
"p_cust_doc"
, OracleDbType.Varchar2, 100).Value = txtbox8;
com.Parameters.Add(
"p_creator"
, OracleDbType.Int32, 10).Value = Session[
"UserID"
].ToString();
com.Parameters.Add(
"p_error_out"
, OracleDbType.Varchar2, 1000).Direction = ParameterDirection.Output;
con.Open();
com.ExecuteNonQuery();
con.Close();
if
(com.Parameters[
"p_error_out"
].Value.ToString() ==
"0"
)
{
RadGrid1.MasterTableView.IsItemInserted =
false
;
RadGrid1.Rebind();
}
else
{
}
}
catch
(Exception ex)
{
}
finally
{
}
}
}
protected
void
RadGrid3_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
string
id =
"1i"
;
OracleConnection con =
new
OracleConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString10"
].ConnectionString);
RadGrid grid = (RadGrid)source;
// Get reference to grid
GridDataItem item = (GridDataItem)(grid.NamingContainer
as
GridEditFormItem).ParentItem;
// Get the mastertableview item
if
(item !=
null
)
{
id = item[
"reception_code"
].Text;
// Get the value
}
try
{
OracleCommand com =
new
OracleCommand(
"receptions.get_rec"
);
com.CommandType = CommandType.StoredProcedure;
com.Connection = con;
com.Parameters.Add(
"p_rec_id"
, OracleDbType.Int32, 10).Value = id.Replace(
"i"
,
null
);
com.Parameters.Add(
"info"
, OracleDbType.RefCursor).Direction = ParameterDirection.Output;
OracleDataAdapter da =
new
OracleDataAdapter(com);
DataSet ds =
new
DataSet();
da.Fill(ds);
grid.DataSource = ds.Tables[0].DefaultView;
}
catch
(Exception ex)
{
}
finally
{
}
}
0

Alex
Top achievements
Rank 2
answered on 03 Jul 2013, 07:04 AM
JScript:
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function RowDblClick(sender, args)
{
document.getElementById("<%=Label2.ClientID %>").innerHTML=args.getDataKeyValue("reception_code");
document.getElementById("<%=Label1.ClientID %>").innerHTML=args.getDataKeyValue("reception_id");
document.getElementById("<%=Label13.ClientID %>").innerHTML=args.getDataKeyValue("owner_id");
}
</
script
>
</
telerik:RadCodeBlock
>
0
Hi,
I was able to replicate the issue you are facing. We will consider this behavior as a bug in our Q2.2013 release. The issue has been logged and you could monitor its status from here.
Your Telerik points have been updated accordingly.
Please excuse us for any inconvenience caused.
Regards,
Andrey
Telerik
I was able to replicate the issue you are facing. We will consider this behavior as a bug in our Q2.2013 release. The issue has been logged and you could monitor its status from here.
Your Telerik points have been updated accordingly.
Please excuse us for any inconvenience caused.
Regards,
Andrey
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0

Alex
Top achievements
Rank 2
answered on 08 Jul 2013, 11:43 AM
Hi Andrey,
Thanks for this. While I am waiting for that fix, can you suggest me some other type of control that can replace the nested RadGrid and also can be populated with data from dataset object. It is a fact that I would be not able to use the benefits of NeedDataSource method but will be a solution for now.
10x
Alex
Thanks for this. While I am waiting for that fix, can you suggest me some other type of control that can replace the nested RadGrid and also can be populated with data from dataset object. It is a fact that I would be not able to use the benefits of NeedDataSource method but will be a solution for now.
10x
Alex
0
Hi,
If you need to only display data through the inner Grid you may use ASP GridView or you could use RadListView with template that made the look similar to RadGrid.
Another way is to hook the RowSelecting and RowDblClick client-events of RadGrid and check whether the parent of the item you have clicked on is the same as the sender of the event, if not you should cancel the event or stop executing your logic.
Regards,
Andrey
Telerik
If you need to only display data through the inner Grid you may use ASP GridView or you could use RadListView with template that made the look similar to RadGrid.
Another way is to hook the RowSelecting and RowDblClick client-events of RadGrid and check whether the parent of the item you have clicked on is the same as the sender of the event, if not you should cancel the event or stop executing your logic.
Regards,
Andrey
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.