Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Imports VillageClassDataAccess
Partial Class ModuleFI_FIBankExtrait
Inherits System.Web.UI.Page
Private Sub _Default_Load(sender As Object, e As EventArgs) Handles Me.Load
Me.Form.DefaultButton = HiddenButtonUniqueID.UniqueID
If Not Me.IsPostBack Then
Dim FldRStatus As RadioButtonList = DirectCast(Me.RadToolBar1.Items(5).FindControl("FldRStatus"), RadioButtonList)
''here i try to add the handler
AddHandler FldRStatus.SelectedIndexChanged, AddressOf FldRStatus_SelectedIndexChanged
Dim FldDocDateFrom As RadDatePicker = DirectCast(Me.RadToolBar1.Items(2).FindControl("FldDocDateFrom"), RadDatePicker)
Dim FldDocDateTo As RadDatePicker = DirectCast(Me.RadToolBar1.Items(3).FindControl("FldDocDateTo"), RadDatePicker)
FldDocDateFrom.SelectedDate = Now
FldDocDateTo.SelectedDate = Now
End If
End Sub
Private Sub RadGridSW_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGridSW.NeedDataSource
Dim FldRStatus As RadioButtonList = DirectCast(Me.RadToolBar1.Items(5).FindControl("FldRStatus"), RadioButtonList)
If FldRStatus.SelectedValue.ToString = "0" Then Exit Sub
Dim FldDocDateFrom As RadDatePicker = DirectCast(Me.RadToolBar1.Items(2).FindControl("FldDocDateFrom"), RadDatePicker)
Dim FldDocDateTo As RadDatePicker = DirectCast(Me.RadToolBar1.Items(3).FindControl("FldDocDateTo"), RadDatePicker)
'' ...
End Sub
Private Sub RadGridVISTA_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGridVISTA.NeedDataSource
Dim FldRStatus As RadioButtonList = DirectCast(Me.RadToolBar1.Items(5).FindControl("FldRStatus"), RadioButtonList)
If FldRStatus.SelectedValue.ToString = "0" Then Exit Sub
Dim FldDocDateFrom As RadDatePicker = DirectCast(Me.RadToolBar1.Items(2).FindControl("FldDocDateFrom"), RadDatePicker)
Dim FldDocDateTo As RadDatePicker = DirectCast(Me.RadToolBar1.Items(3).FindControl("FldDocDateTo"), RadDatePicker)
''..
End Sub
Private Sub RadGridRR_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGridRR.NeedDataSource
Dim FldRStatus As RadioButtonList = DirectCast(Me.RadToolBar1.Items(5).FindControl("FldRStatus"), RadioButtonList)
If FldRStatus.SelectedValue.ToString = "1" Then Exit Sub
''..
End Sub
Protected Sub CmdRefresh_Click(sender As Object, e As ImageButtonClickEventArgs)
RadGridSW.Rebind()
RadGridVISTA.Rebind()
RadGridRR.Rebind()
End Sub
Protected Sub FldRStatus_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim FldRStatus As RadioButtonList = DirectCast(sender, RadioButtonList)
FldRStatus.AutoPostBack = True
If FldRStatus.SelectedValue.ToString = "0" Then
TblNotReconciled.Visible = False
Else
TblNotReconciled.Visible = True
End If
TblReconciled.Visible = Not TblNotReconciled.Visible
CmdRefresh_Click(Nothing, Nothing)
End Sub
Protected Sub RadToolBar1_ButtonClick1(sender As Object, e As RadToolBarEventArgs) Handles RadToolBar1.ButtonClick
Select Case e.Item.Value.ToUpper
Case "XLS"
RadGridSW.ExportSettings.FileName = "PaymentsReconcile"
RadGridSW.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx
RadGridSW.ExportSettings.IgnorePaging = True
RadGridSW.ExportToExcel()
Case "CardLink".ToUpper
RadToolBar1.Items(4).Text = e.Item.Text
HiddenSwitchOrgValue.Value = e.Item.Value
CmdRefresh_Click(Nothing, Nothing)
Case "WINBANK"
RadToolBar1.Items(4).Text = e.Item.Text
HiddenSwitchOrgValue.Value = e.Item.Value
CmdRefresh_Click(Nothing, Nothing)
End Select
End Sub
Private Sub ModuleFI_FIBankExtrait_Init(sender As Object, e As EventArgs) Handles Me.Init
If Not Me.IsPostBack Then
Dim FldDocDateFrom As RadDatePicker = DirectCast(Me.RadToolBar1.Items(2).FindControl("FldDocDateFrom"), RadDatePicker)
Dim FldDocDateTo As RadDatePicker = DirectCast(Me.RadToolBar1.Items(3).FindControl("FldDocDateTo"), RadDatePicker)
FldDocDateTo.SelectedDate = Date.Now
FldDocDateFrom.SelectedDate = DateAdd(DateInterval.Month, -1, Date.Now)
End If
End Sub
Protected Sub RadMenu1_ItemClick(ByVal sender As Object, ByVal e As RadMenuEventArgs)
If e.Item.Text.ToUpper <> "Match".ToUpper Then Exit Sub
If RadGridSW.SelectedItems.Count <> 1 Or RadGridVISTA.SelectedItems.Count <> 1 Then Exit Sub
Dim clsMatchSW As New MatchBankID
For Each item As GridDataItem In RadGridSW.SelectedItems
clsMatchSW.PaymentSwitchOrg = item.GetDataKeyValue("SwitchOrg")
clsMatchSW.PaymentSwitchOrgID = item.GetDataKeyValue("SwitchOrgID")
Next
For Each item As GridDataItem In RadGridVISTA.SelectedItems
clsMatchSW.DWCinemaCode = item.GetDataKeyValue("CinemaCode")
clsMatchSW.DWVistaTransaction = item.GetDataKeyValue("TransNumber")
clsMatchSW.DWVistaTransactionSequence = item.GetDataKeyValue("TransSequence")
Next
Dim vu As New VillageUserRoles
clsMatchSW.UserID = vu.UserID
If String.IsNullOrEmpty(clsMatchSW.DWCinemaCode) _
OrElse String.IsNullOrEmpty(clsMatchSW.DWVistaTransaction) OrElse String.IsNullOrEmpty(clsMatchSW.PaymentSwitchOrg) _
OrElse String.IsNullOrEmpty(clsMatchSW.PaymentSwitchOrgID) OrElse String.IsNullOrEmpty(clsMatchSW.DWVistaTransactionSequence) _
OrElse String.IsNullOrEmpty(clsMatchSW.UserID) Then
Exit Sub
End If
If updateDWSWTable(clsMatchSW) Then CmdRefresh_Click(Nothing, Nothing)
End Sub
lease note that the radiobuttonlist is inside a telerik control, so I'm not sure if that plays a role.
I wiil try to get it out of the telerik group to see if it works.
Is there a way or a thought to make the simple radiolist to work?
Thanks.
Well, when you moved the radiobuttonlist outside the telerik control and it works so it has something with how the telerik control works or your understanding of how the control works. I'm guessing it has something to do with the RadAjaxManager control.
Updating the DOM is destructive to the client side events that are wired up (by AutoPostBack="True") when the page initially loads. If you overwrite the radio button HTML then all the client side events are lost. You need to reassign the client events.
Since you are using the RadAjaxManager, you should learn how the controls work by reading the Telerik the documentation.
Member
226 Points
904 Posts
RadioButtonList only fire once.
Mar 27, 2017 01:05 PM|sapator|LINK
Hi.
I'm building this asp.net - telerik app and I have a RadioButtonList that only fires once.
I have tried to add a handler to the page loading but still will only fire once.
I have tried to add the handler - through the load page to the handled event but that did not work either.
To be more specific, it will only fire when I click on one of the two RadioButtons and the other one will not fire.
code without the data manips:
lease note that the radiobuttonlist is inside a telerik control, so I'm not sure if that plays a role.
I wiil try to get it out of the telerik group to see if it works.
Member
226 Points
904 Posts
Re: RadioButtonList only fire once.
Mar 27, 2017 01:24 PM|sapator|LINK
Hi.
Yes the problem is when it is inside the telerik toolbar.
Any thoughts?
I have tried the custom telerik radiobuttonlist but is messing all the design really bad.
Is there another way?
thanks.
All-Star
52101 Points
23237 Posts
Re: RadioButtonList only fire once.
Mar 27, 2017 01:26 PM|mgebhard|LINK
You should ask this question on the telerik forum.
Member
226 Points
904 Posts
Re: RadioButtonList only fire once.
Mar 27, 2017 02:01 PM|sapator|LINK
Hi.
Before that.
Is there a way or a thought to make the simple radiolist to work?
Thanks.
All-Star
52101 Points
23237 Posts
Re: RadioButtonList only fire once.
Mar 27, 2017 02:30 PM|mgebhard|LINK
Well, when you moved the radiobuttonlist outside the telerik control and it works so it has something with how the telerik control works or your understanding of how the control works. I'm guessing it has something to do with the RadAjaxManager control. Updating the DOM is destructive to the client side events that are wired up (by AutoPostBack="True") when the page initially loads. If you overwrite the radio button HTML then all the client side events are lost. You need to reassign the client events.
Since you are using the RadAjaxManager, you should learn how the controls work by reading the Telerik the documentation.
Member
226 Points
904 Posts
Re: RadioButtonList only fire once.
Mar 27, 2017 02:55 PM|sapator|LINK
Ok.
Currently nothing works.
I have tried:
http://www.telerik.com/forums/radajaxmanager-won-t-work-with-radiobuttonlist
http://www.telerik.com/forums/the-radajaxmanager-do-not-fire-postback-with-radiobuttonlist
http://www.telerik.com/forums/postback-not-firing-for-radiobuttonlist
http://www.telerik.com/forums/radajaxmanager-does-not-work-with-radiobuttons-radiobuttonlists
They all indicate that there are errors on how the control works with Ajax but every solution I tried won't work.
I think I'll try the telerik radiolist and hope I can fix the appearance issues I go before.
I will post back if I find or do not find the solution.
Thanks.
Member
226 Points
904 Posts
Re: RadioButtonList only fire once.
Mar 28, 2017 09:30 AM|sapator|LINK
Nothing worked, so I'm using a telerik RadiobuttonList to make it work