Hi all,
I've got a grid more or less with the same functionality as the one that you've got in the demo "Usercontrol edit form", this page is under a Master page that has got some buttons like a search button that raises the event search and a Reload is launched with all the needed params that fills a DataSet and binds to the datagrid.
My problem is that this search is not working, the event is fired, the dataset is filled with correct data, the Grid is rebinded but it doesn't show the correct data, it doesn't reload, I tried to solve with an update panel, it works pretty good but when I try to edit a row it throws me a jscript error that says me that "can't find update panel Ctl00_00_...", and if I haven't got the update panel my search event doesn't work.
This is the content of the page:
And this is the VB:
Is there anyway to use the radajaxmanagerproxy to make the grid reload when the Masterfind event is raised?
Thanks in advance,
I've got a grid more or less with the same functionality as the one that you've got in the demo "Usercontrol edit form", this page is under a Master page that has got some buttons like a search button that raises the event search and a Reload is launched with all the needed params that fills a DataSet and binds to the datagrid.
My problem is that this search is not working, the event is fired, the dataset is filled with correct data, the Grid is rebinded but it doesn't show the correct data, it doesn't reload, I tried to solve with an update panel, it works pretty good but when I try to edit a row it throws me a jscript error that says me that "can't find update panel Ctl00_00_...", and if I haven't got the update panel my search event doesn't work.
This is the content of the page:
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManagerProxy1"
runat
=
"server"
Visible
=
"False"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"UPPantalla"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"GridAlbaranes"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"GridAlbaranes"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"GridAlbaranes"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
div
id
=
"box_Cabecera"
>
<
div
id
=
"datos_Izquierda"
>
<
ol
>
<
li
><
asp:Label
ID
=
"LblProveedor"
runat
=
"server"
Text
=
"Proveedor: "
Font-Names
=
"Trebuchet MS"
Font-Size
=
"Small"
CssClass
=
"literal"
></
asp:Label
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"CmbProveedor"
DataTextField
=
"LargeName"
DataValueField
=
"Account"
AllowCustomText
=
"True"
width
=
"300px"
Filter
=
"Contains"
MarkFirstMatch
=
"True"
></
telerik:RadComboBox
></
li
>
<
li
><
asp:Label
ID
=
"LblAno"
runat
=
"server"
Text
=
"Año: "
Font-Names
=
"Trebuchet MS"
Font-Size
=
"Small"
CssClass
=
"literal"
></
asp:Label
>
<
telerik:RadNumericTextBox
ID
=
"TxbYear"
Runat
=
"server"
ShowSpinButtons
=
"True"
Font-Names
=
"Trebuchet MS"
Font-Size
=
"Small"
>
<
NumberFormat
DecimalDigits
=
"0"
GroupSeparator
=
""
/>
</
telerik:RadNumericTextBox
></
li
>
</
ol
>
</
div
>
<
div
id
=
"datos_Derecha"
>
<
ol
>
<
li
><
asp:Label
ID
=
"LblCentro"
runat
=
"server"
Text
=
"Centro: "
Font-Names
=
"Trebuchet MS"
Font-Size
=
"Small"
CssClass
=
"literal"
></
asp:Label
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"CmbCentro"
DataTextField
=
"ProfitCenterLargeName"
DataValueField
=
"ProfitCenterCode"
AllowCustomText
=
"True"
Width
=
"300px"
height
=
"200px"
Filter
=
"Contains"
Skin
=
"Sunset"
></
telerik:RadComboBox
>
</
li
>
<
li
> <
telerik:RadButton
ID
=
"BtnSoloSinValidar"
runat
=
"server"
AutoPostBack
=
"False"
BorderStyle
=
"Groove"
Checked
=
"True"
Skin
=
"Sunset"
Text
=
"Solo Albaranes no validados"
ToggleType
=
"CheckBox"
>
</
telerik:RadButton
></
li
>
</
ol
>
</
div
></
div
>
<
div
id
=
"Grid"
>
<
telerik:RadGrid
runat
=
"server"
Skin
=
"Sunset"
Width
=
"90%"
ID
=
"GridAlbaranes"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
>
<
MasterTableView
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"PCNameComplet"
HeaderText
=
"Centro"
UniqueName
=
"PCNameComplet"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplierName"
HeaderText
=
"Proveedor"
UniqueName
=
"SupplierName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"IdGRN"
HeaderText
=
"Albarán"
UniqueName
=
"IdGRN"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Year"
HeaderText
=
"Año"
UniqueName
=
"year"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Cuenta"
HeaderText
=
"Cuenta"
UniqueName
=
"Cuenta"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SupplierAccount"
HeaderText
=
"Codigo Proveedor"
UniqueName
=
"SupplierAccount"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProfitCenterCode"
HeaderText
=
"ProfitCenter"
UniqueName
=
"ProfitCenter"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Amount"
HeaderText
=
"Importe"
UniqueName
=
"Amount"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
UserControlName
=
"../UserControl/CuGRN.ascx"
EditFormType
=
"WebUserControl"
>
<
EditColumn
UniqueName
=
"EditCommandColumn"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Sunset"
EnableImageSprites
=
"True"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
</
div
>
And this is the VB:
Public
Class
ListadoAlbaranes
Inherits
System.Web.UI.Page
Protected
WithEvents
Mymaster
As
Site
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
Mymaster =
Me
.Master
If
Not
Me
.IsPostBack
Then
LoadCombos()
Me
.TxbYear.Text = Today.
Date
.Year
CargarGrid()
End
If
End
Sub
Public
Sub
LoadCombos()
'+-----------------------------------------------------
'| Comments: Used to load combos.
'+-----------------------------------------------------
Dim
Usuario
As
ClUsuario =
New
ClUsuario
Usuario =
CType
(Session(
"Usuario"
), ClUsuario)
Dim
c
As
New
AraSql
c.SqlServer = Usuario.SqlServer(
"Cotejador"
)
c.CommandText =
"Ara_CargaMaeSupandProfCen"
c.Ejecutar()
c.Tables(0).Rows.Add(
"0"
,
"Todos"
)
CmbProveedor.DataSource = c.Tables(0)
CmbProveedor.DataBind()
CmbProveedor.SelectedValue =
"0"
c.Tables(1).Rows.Add(
"0"
,
"Todos"
)
CmbCentro.DataSource = c.Tables(1)
CmbCentro.DataBind()
CmbCentro.SelectedValue = 0
End
Sub
Private
Sub
CargarGrid()
Try
Dim
usuario
As
ClUsuario =
New
ClUsuario
Dim
c
As
New
AraSql
c.SqlServer = usuario.SqlServer(
"Cotejador"
)
c.CommandText =
"Ara_ListGRNs"
If
CmbCentro.SelectedValue <>
"0"
Then
c.NewParameter(
"@ProfitCenterCode"
, SqlDbType.VarChar,
Me
.CmbCentro.SelectedValue)
End
If
If
CmbProveedor.SelectedValue <>
"0"
Then
c.NewParameter(
"@SupplierAccount"
, SqlDbType.VarChar,
Me
.CmbProveedor.SelectedValue)
End
If
c.NewParameter(
"@Onlyopen"
, SqlDbType.Bit,
Me
.BtnSoloSinValidar.Checked)
c.NewParameter(
"@year"
, SqlDbType.VarChar,
Me
.TxbYear.Value)
c.Ejecutar()
Me
.GridAlbaranes.Dispose()
Me
.GridAlbaranes.DataSource = c.Tables(0)
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ReloadGrid()
Handles
Mymaster.MasterFind
GridAlbaranes.DataSource =
Nothing
GridAlbaranes.Rebind()
End
Sub
Protected
Sub
RadGrid1_NeedDataSource(
ByVal
source
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
GridAlbaranes.NeedDataSource
CargarGrid()
End
Sub
End
Class
Is there anyway to use the radajaxmanagerproxy to make the grid reload when the Masterfind event is raised?
Thanks in advance,