I am using the RadGrid and forcing a rebind of it by using the $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequestWithTarget("<%= RisksRadGrid.UniqueID %>", ""); call. This call is inside a javascript function called riskFilterClick(pControl, pFilter, pFormLoad) a sample call to this function from the onClick event of a td cell looks like riskFilterClick(this, 4, false);. I have several of these calls which are all td cells with images and text in them that the user clicks on to filter the dataset. I have a hidden dropdownlist which the javascript updates the selectedItem in before calling the rebind of the datagrid. In the databinding logic of the grid it reads the value out of the hidden dropdownlist and appends any search text entered by the user in the search textbox. All of this is working great... however my problem is when this same riskFilterClick(this, 4, false); is called by the onClick of an HTML input box for some reason and randomly it seems the images in my grid are not rendered after rebinding? If I "view source" of the grid the <img> tags exist however if I alert the innerHTML of each datagrid cell through javascript popups after the rebinding the image tags are gone? If I click back to another image (different filter and only if I change to a different filter) the grid seems to correct itself and put the images back in??
Be aware that I have 3 user controls included in 1 master page and I have uploaded all the code from just 1 of the user controls although they are all similar and are all experiencing the same problem.
Sorry the code is starting to get a little messy as I've been struggling with this for quite some time now and have been trying a lot of different things to get it working. I've even replaced the input button with another image and used the onClick event of the td cell which is similiar to the other filters that are working but that has produced the same problem with the missing images. Any help would be appreciated.
I should also add that the RequestStart() and HideLoadingPanel() functions as well as the currentLoadingPanel and currentUpdatedControl variables are in a separate JS file that is included in the master aspx page.
Kyle.
Be aware that I have 3 user controls included in 1 master page and I have uploaded all the code from just 1 of the user controls although they are all similar and are all experiencing the same problem.
| <%@ Control Language="VB" AutoEventWireup="true" CodeFile="MyRisks.ascx.vb" Inherits="MyRisks" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <link href="Stylesheets/CustomGridStyle.css" rel="stylesheet" type="text/css" /> |
| <telerik:RadAjaxManagerProxy ID="RisksRadAjaxManager" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RisksRadGrid"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RisksRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="cRiskShow"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RisksRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskShow" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskSearchForText" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskSearchForBtn" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="cRiskSearchForBtn"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RisksRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskShow" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskSearchForText" /> |
| <telerik:AjaxUpdatedControl ControlID="cRiskSearchForBtn" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManagerProxy> |
| <telerik:RadAjaxLoadingPanel ID="RisksRadAjaxLoadingPanel1" runat="server" Transparency="30" IsSticky="true"> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadCodeBlock ID="RiskRadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| var vRiskFilter = 0; //default this to "Open" |
| function riskRowDblClick(sender, eventArgs) { |
| var grid = $find("<%=RisksRadGrid.ClientID %>"); |
| var MasterTable = grid.get_masterTableView(); |
| var vElementNo, vRevision, vDomain; |
| var vCurrentDomain = document.getElementById('<%= hdnRiskCurrentDomain.ClientID %>').value; |
| var selectedRows = MasterTable.get_selectedItems(); |
| for (var i = 0; i < selectedRows.length; i++) { |
| var row = selectedRows[i]; |
| vElementNo = MasterTable.getCellByColumnUniqueName(row, "ElementNo").innerHTML; |
| vDomain = MasterTable.getCellByColumnUniqueName(row, "Domain").innerHTML; |
| vRevision = MasterTable.getCellByColumnUniqueName(row, "Revision").innerHTML; |
| //here ElementNo / Domain / Revision holds the value of the cell |
| } |
| if (vDomain != vCurrentDomain) { |
| window.open('RedirectNewDomain.aspx?Domain=' + vDomain + '&URL=../../Application/BPControls/Redirect.aspx?Link=AT/' + vElementNo + '/' + vRevision + |
| '/Signatures&StartUpCaption=' + vElementNo, '', 'toolbar=no,location=no,menubar=no,directories=no,width=400,height=200'); |
| } |
| else { |
| parent.parent.OpenPageInMDI('../../Application/ActionTracker/AForm.aspx?Element=' + vElementNo + '&Revision=' + vRevision, vElementNo); |
| } |
| } |
| function riskFilterClick(pControl, pFilter, pFormLoad) { |
| //set the global variable for identifying what grid is to be "greyed" out while performing the AJAX call. This |
| //is needed because the MyPims page has 3 user controls in it and they will all "share" this same RequestStart & HideLoadingPanel functions |
| currentUpdatedControl = "<%=RisksRadGrid.ClientID%>"; |
| currentLoadingPanel = "<%=RisksRadAjaxLoadingPanel1.ClientID%>"; |
| //set the global variable holding which filter has been clicked |
| if (pFilter != null) { |
| vRiskFilter = pFilter; |
| //loops through td cells and resets backgrounds to white. |
| var cCells = document.getElementById("cRiskfilterTable").getElementsByTagName("td"); |
| var cNumCells = cCells.length; |
| for (var i = 0; i < cNumCells; ++i) { |
| if (cCells[i].className == "Filters") { |
| cCells[i].style.backgroundColor = 'white'; |
| } |
| } |
| } |
| pControl.style.backgroundColor = '#bbd7fa'; //highlight selected td cell |
| //reset background of search button if search text box is empty |
| if (document.getElementById('<%=cRiskSearchForText.ClientID %>').value == "") { |
| document.getElementById('cRiskSearchForBtn').style.backgroundColor = 'white'; |
| } |
| else { |
| document.getElementById('cRiskSearchForBtn').style.backgroundColor = '#bbd7fa'; |
| } |
| if (pFilter != null) { |
| //get the client side ID of the dropdownlist |
| var cDropDownList = document.getElementById('<%=cRiskShow.ClientID %>'); |
| cDropDownList.options[vRiskFilter].selected = true; |
| } |
| if (!pFormLoad) { |
| $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequestWithTarget("<%= RisksRadGrid.UniqueID %>", ""); |
| } |
| } |
| function startUpRiskScript() { |
| addMaskToRiskSorting(); |
| var cDropDownList = document.getElementById('<%=cRiskShow.ClientID %>'); |
| //find which control that needs to be highlighted by default onLoad of control. |
| var cCells = document.getElementById("cRiskfilterTable").getElementsByTagName("td"); |
| var cNumCells = cCells.length; |
| for (var i = 0; i < cNumCells; ++i) { |
| if (cCells[i].className == "Filters") { |
| if (cCells[i].name.toUpperCase() == cDropDownList.options[cDropDownList.selectedIndex].text.toUpperCase()) { |
| riskFilterClick(cCells[i], cDropDownList.selectedIndex.value, true); |
| } |
| } |
| } |
| } |
| function addMaskToRiskSorting() { |
| //Need this to get the mask to work when sorting the grid |
| //Set up the risks grid headers |
| cHeaders = document.getElementById("<%=RisksRadGrid.ClientID %>").getElementsByTagName("a"); |
| cNumCells = cHeaders.length; |
| for (x = 0; x < cNumCells; ++x) { |
| if (cHeaders[x].href.indexOf("setRiskGlobalVariables();RequestStart(null, null);") == -1) { |
| cHeaders[x].href = "javascript:setRiskGlobalVariables();RequestStart(null, null);" + cHeaders[x].href.replace(/javascript:/, ''); |
| } |
| } |
| } |
| function setRiskGlobalVariables() { |
| currentUpdatedControl = "<%=RisksRadGrid.ClientID%>"; |
| currentLoadingPanel = "<%=RisksRadAjaxLoadingPanel1.ClientID%>"; |
| } |
| </script> |
| </telerik:RadCodeBlock> |
| <table style="width: 90%; height: 100%;"> |
| <tr> |
| <td> |
| <table style="height:40px"> |
| <tr> |
| <td style="display:none"> |
| Show: |
| </td> |
| <td style="display:none;"> |
| <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="cRiskShow_SelectedIndexChanged" |
| ID="cRiskShow" runat="server" Width="150px"> |
| <asp:ListItem Value="0" Selected="True">Open</asp:ListItem> |
| <asp:ListItem Value="1">Closed</asp:ListItem> |
| <asp:ListItem Value="2">No Filter</asp:ListItem> |
| <asp:ListItem Value="3">Very Low</asp:ListItem> |
| <asp:ListItem Value="4">Low</asp:ListItem> |
| <asp:ListItem Value="5">Medium</asp:ListItem> |
| <asp:ListItem Value="6">High</asp:ListItem> |
| <asp:ListItem Value="7">Very High</asp:ListItem> |
| </asp:DropDownList> |
| </td> |
| <td nowrap="nowrap"> |
| Filter For: |
| </td> |
| <td style="width: 200px"> |
| <telerik:RadTextBox ID="cRiskSearchForText" Width="200px" runat="server" Skin="Office2007" AutoPostBack="true" OnTextChanged="RadTextBox1_TextChanged"> |
| </telerik:RadTextBox> |
| </td> |
| <td style="width: 50px"> |
| <input type="button" id="cRiskSearchForBtn" value="Search" onclick="riskFilterClick(this, null, false);RequestStart(null, null);" /> |
| </td> |
| <td style="width:10px"></td> |
| <td style="width:100%" align="right"> |
| <table id="cRiskfilterTable" style="height: 40px; font-family: Arial; font-size: 8pt" cellpadding="2"> |
| <tr> |
| <td style="width:100%" align="right" colspan="5"> </td> |
| <td name="Open" nowrap="nowrap" class="Filters" title="Filter for Open Risks" onclick="riskFilterClick(this, 0, false);RequestStart(null, null);"> |
| <img src="Images/email_open.png" alt="" /> Open</td> |
| <td style="width: 10px"></td> |
| <td nowrap="nowrap" name="Closed" class="Filters" title="Filter for Closed Risks" onclick="riskFilterClick(this, 1, false);RequestStart(null, null);"> |
| <img src="Images/email.png" alt="" /> Closed</td> |
| <td style="width: 10px"></td> |
| <td nowrap="nowrap" name="No Filter" class="Filters" title="No Filter" onclick="riskFilterClick(this, 2, false);RequestStart(null, null);"> |
| <img src="Images/cancel.png" alt="" /> No Filter</td> |
| <td style="width: 10px"></td> |
| </tr> |
| <tr> |
| <td style="width:100%"> </td> |
| <td name="Very Low" nowrap="nowrap" class="Filters" title="Filter for Very Low Risks" onclick="riskFilterClick(this, 3, false);RequestStart(null, null);"> |
| <img src="Images/bubble_aqua.gif" alt="" />Very Low</td> |
| <td style="width: 10px"></td> |
| <td name="Low" nowrap="nowrap" class="Filters" title="Filter for Low Risks" onclick="riskFilterClick(this, 4, false);RequestStart(null, null);"> |
| <img src="Images/bubble_green.gif" alt="" />Low</td> |
| <td style="width: 10px"></td> |
| <td name="Medium" nowrap="nowrap" class="Filters" title="Filter for Medium Risks" onclick="riskFilterClick(this, 5, false);RequestStart(null, null);"> |
| <img src="Images/bubble_yellow.gif" alt="" />Medium</td> |
| <td style="width: 10px"></td> |
| <td name="High" nowrap="nowrap" class="Filters" title="Filter for High Risks" onclick="riskFilterClick(this, 6, false);RequestStart(null, null);"> |
| <img src="Images/bubble_orange.gif" alt="" />High</td> |
| <td style="width: 10px"></td> |
| <td name="Very High" nowrap="nowrap" class="Filters" title="Filter for Very High Risks" onclick="riskFilterClick(this, 7, false);RequestStart(null, null);"> |
| <img src="Images/bubble_red.gif" alt="" />Very High</td> |
| <td style="width: 10px"></td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="RisksRadGrid" PageSize="50" runat="server" Height="400px" BackColor="#CDE4FA"> |
| <FooterStyle CssClass="GridFooter_Office2007"></FooterStyle> |
| <SelectedItemStyle CssClass="GridSelectedItemStyle" /> |
| <HeaderContextMenu Skin="Office2007" EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <MasterTableView> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <AlternatingItemStyle CssClass="GridAltItemStyle" /> |
| </MasterTableView> |
| <ClientSettings> |
| <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"> |
| </Scrolling> |
| <Selecting AllowRowSelect="true" /> |
| <ClientEvents OnRowDblClick="riskRowDblClick" /> |
| </ClientSettings> |
| <FilterMenu Skin="Office2007" EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| <input id="hdnRiskCurrentDomain" type="text" runat="server" style="display:none" /> |
| </table> |
| <script language="javascript"> |
| startUpRiskScript(); |
| </script> |
| Imports System |
| Imports System.Data |
| Imports System.Configuration |
| Imports System.Collections |
| Imports System.Web |
| Imports System.Web.Security |
| Imports System.Web.UI |
| Imports System.Web.UI.WebControls |
| Imports System.Web.UI.WebControls.WebParts |
| Imports System.Web.UI.HtmlControls |
| Imports System.Xml |
| Imports System.Text |
| Imports Appframe3.Common.Data |
| Imports Appframe3.Web.Common |
| Imports Telerik.Web.UI |
| Partial Class MyRisks |
| Inherits System.Web.UI.UserControl |
| Private Const gMaxDays As Integer = 999999 |
| Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) |
| SetDomainSettings() |
| RisksRadGrid.Columns.Clear() |
| GetElements() |
| 'If String.IsNullOrEmpty(RadAjaxManager.GetCurrent(Me.Page).ClientEvents.OnRequestStart) Then |
| ' RadAjaxManager.GetCurrent(Me.Page).ClientEvents.OnRequestStart = "RequestStart" |
| 'End If |
| If String.IsNullOrEmpty(RadAjaxManager.GetCurrent(Me.Page).ClientEvents.OnResponseEnd) Then |
| RadAjaxManager.GetCurrent(Me.Page).ClientEvents.OnResponseEnd = "HideLoadingPanel" |
| End If |
| End Sub |
| Private Sub SetDomainSettings() |
| Dim vRecordSource As New afRecordSource |
| vRecordSource.ViewName = "stbv_System_Users" |
| vRecordSource.SelectColumns.Add("CurrentDomain") |
| vRecordSource.SelectColumns.ExcludePrimKey = True |
| vRecordSource.WhereClause = "Login = SUSER_SNAME()" |
| Dim vCurDomain As String = afAccessLayer.GetDataScalar(vRecordSource).ToString() |
| hdnRiskCurrentDomain.Value = vCurDomain |
| End Sub |
| Private Sub GetElements() |
| Dim vProcedure As New afProcedureCall |
| vProcedure.ProcedureName = "astp_RiskMgmt_MissingRisks" |
| Dim vDataTable As DataTable = afAccessLayer.ExecProcedure(vProcedure).Tables(0) |
| Dim vSearchText As String = "" |
| Dim vOrderBy As String = "OpenStatus DESC, RiskScoreNumber DESC, WBSLevel3, ElementID, ID" |
| vSearchText = "ISNULL([Risk ID],'') + ISNULL(Title,'') + ISNULL([Risk Type],'') + ISNULL([Risk Score],'') + ISNULL(Status,'') Like '%" + cRiskSearchForText.Text.Trim + "%' AND " |
| If cRiskShow.SelectedValue = "0" Then 'Open |
| vSearchText += "OpenStatus = 1 " |
| ElseIf cRiskShow.SelectedValue = "1" Then 'Closed |
| vSearchText += "OpenStatus = 0 " |
| ElseIf cRiskShow.SelectedValue = "2" Then 'No Filter |
| vSearchText += vSearchText.Replace(" AND ", "") |
| ElseIf cRiskShow.SelectedValue = "3" Then 'Very Low |
| vSearchText += "[Risk Score] = 'Very Low'" |
| ElseIf cRiskShow.SelectedValue = "4" Then 'Low |
| vSearchText += "[Risk Score] = 'Low'" |
| ElseIf cRiskShow.SelectedValue = "5" Then 'Medium |
| vSearchText += "[Risk Score] = 'Medium'" |
| ElseIf cRiskShow.SelectedValue = "6" Then 'High |
| vSearchText += "[Risk Score] = 'High'" |
| ElseIf cRiskShow.SelectedValue = "7" Then 'Very High |
| vSearchText += "[Risk Score] = 'Very High'" |
| End If |
| RisksRadGrid.DataSource = vDataTable.[Select](vSearchText, vOrderBy) |
| RisksRadGrid.AutoGenerateColumns = False |
| RisksRadGrid.DataSource = vDataTable.[Select](vSearchText, vOrderBy) |
| RisksRadGrid.Width = Unit.Pixel(1005) |
| RisksRadGrid.GridLines = GridLines.None |
| RisksRadGrid.AllowSorting = True |
| RisksRadGrid.AllowPaging = False |
| RisksRadGrid.Skin = "Office2007" |
| RisksRadGrid.ShowFooter = True |
| Dim vColumnImage As New GridTemplateColumn |
| RisksRadGrid.Columns.Add(vColumnImage) |
| vColumnImage.UniqueName = "ImgColumn" |
| vColumnImage.HeaderText = "" |
| vColumnImage.ItemStyle.Width = Unit.Pixel(20) |
| vColumnImage.HeaderStyle.Width = Unit.Pixel(20) |
| Dim vColumn As New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Domain" |
| vColumn.HeaderText = "Domain" |
| vColumn.UniqueName = "Domain" |
| vColumn.AllowSorting = True |
| vColumn.ItemStyle.Width = Unit.Pixel(60) |
| vColumn.HeaderStyle.Width = Unit.Pixel(60) |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "OpenStatus" |
| vColumn.HeaderText = "" |
| vColumn.UniqueName = "OpenStatus" |
| vColumn.Visible = False |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Risk ID" |
| vColumn.HeaderText = "ID" |
| vColumn.UniqueName = "ElementNo" |
| vColumn.AllowSorting = True |
| vColumn.ItemStyle.Width = Unit.Pixel(150) |
| vColumn.HeaderStyle.Width = Unit.Pixel(150) |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Title" |
| vColumn.HeaderText = "Title" |
| vColumn.AllowSorting = True |
| vColumn.ItemStyle.Width = Unit.Pixel(300) |
| vColumn.HeaderStyle.Width = Unit.Pixel(300) |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Risk Type" |
| vColumn.HeaderText = "Risk Type" |
| 'vColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center |
| vColumn.AllowSorting = True |
| vColumn.ItemStyle.Width = Unit.Pixel(100) |
| vColumn.HeaderStyle.Width = Unit.Pixel(100) |
| vColumn.DataFormatString = "{0:d}" |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Risk Score" |
| vColumn.HeaderText = "Risk Score" |
| vColumn.UniqueName = "RiskScore" |
| 'vColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center |
| vColumn.AllowSorting = True |
| vColumn.ItemStyle.Width = Unit.Pixel(100) |
| vColumn.HeaderStyle.Width = Unit.Pixel(100) |
| vColumnImage = New GridTemplateColumn |
| RisksRadGrid.Columns.Add(vColumnImage) |
| vColumnImage.UniqueName = "ColorColumn" |
| vColumnImage.HeaderText = "" |
| vColumnImage.ItemStyle.Width = Unit.Pixel(20) |
| vColumnImage.HeaderStyle.Width = Unit.Pixel(20) |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "Status" |
| vColumn.UniqueName = "Status" |
| vColumn.HeaderText = "Status" |
| vColumn.AllowSorting = True |
| vColumn.Aggregate = GridAggregateFunction.Count |
| vColumn.FooterText = "Total Risks: " |
| 'vColumn.ItemStyle.Width = Unit.Pixel(75) |
| 'vColumn.HeaderStyle.Width = Unit.Pixel(75) |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "WBSLevel3" |
| vColumn.HeaderText = "" |
| vColumn.UniqueName = "WBSLevel3" |
| vColumn.Visible = False |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "ElementID" |
| vColumn.HeaderText = "" |
| vColumn.UniqueName = "ElementID" |
| vColumn.Visible = False |
| vColumn = New GridBoundColumn |
| RisksRadGrid.Columns.Add(vColumn) |
| vColumn.DataField = "ID" |
| vColumn.HeaderText = "" |
| vColumn.UniqueName = "ID" |
| vColumn.Visible = False |
| End Sub |
| Protected Sub RisksRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RisksRadGrid.ItemDataBound |
| If TypeOf e.Item Is GridDataItem Then |
| Dim item As GridDataItem = TryCast(e.Item, GridDataItem) |
| Dim img As New Image() |
| img.ID = "Image1" |
| If item("OpenStatus").Text = "1" Then |
| img.ImageUrl = "Images/email_open.png" |
| Else |
| img.ImageUrl = "Images/email.png" |
| End If |
| item("ImgColumn").Controls.Add(img) |
| ' Add coloring for items. |
| Dim dataBoundItem As GridDataItem = e.Item |
| Dim imgRed As New Image() |
| imgRed.ID = "ImageRed" |
| imgRed.ImageUrl = "Images/bubble_red.gif" |
| Dim imgOrange As New Image() |
| imgOrange.ID = "ImageOrange" |
| imgOrange.ImageUrl = "Images/bubble_orange.gif" |
| Dim imgGreen As New Image() |
| imgGreen.ID = "ImageGreen" |
| imgGreen.ImageUrl = "Images/bubble_green.gif" |
| Dim imgAqua As New Image() |
| imgOrange.ID = "ImageAqua" |
| imgOrange.ImageUrl = "Images/bubble_aqua.gif" |
| Dim imgYellow As New Image() |
| imgGreen.ID = "ImageYellow" |
| imgGreen.ImageUrl = "Images/bubble_yellow.gif" |
| Select Case dataBoundItem("RiskScore").Text |
| Case "Very High" |
| item("ColorColumn").Controls.Add(imgRed) |
| Exit Select |
| Case "High" |
| item("ColorColumn").Controls.Add(imgOrange) |
| Exit Select |
| Case "Medium" |
| item("ColorColumn").Controls.Add(imgYellow) |
| Exit Select |
| Case "Low" |
| item("ColorColumn").Controls.Add(imgGreen) |
| Exit Select |
| Case "Very Low" |
| item("ColorColumn").Controls.Add(imgAqua) |
| Exit Select |
| End Select |
| End If |
| End Sub |
| Private Sub RisksRadGrid_PageIndexChanged(ByVal source As Object, ByVal e As GridPageChangedEventArgs) Handles RisksRadGrid.PageIndexChanged |
| GetElements() |
| End Sub |
| Public Sub RisksRadGrid_SortCommand(ByVal source As Object, ByVal e As GridSortCommandEventArgs) Handles RisksRadGrid.SortCommand |
| RisksRadGrid.MasterTableView.Rebind() |
| End Sub |
| Protected Sub cRiskShow_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) 'Handles cRiskShow.SelectedIndexChanged |
| RisksRadGrid.MasterTableView.Rebind() |
| End Sub |
| Protected Sub cSearchForBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Handles cSearchForBtn.Click |
| RisksRadGrid.MasterTableView.Rebind() |
| End Sub |
| Protected Sub RadTextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) |
| 'RisksRadGrid.MasterTableView.Rebind() |
| End Sub |
| End Class |
Sorry the code is starting to get a little messy as I've been struggling with this for quite some time now and have been trying a lot of different things to get it working. I've even replaced the input button with another image and used the onClick event of the td cell which is similiar to the other filters that are working but that has produced the same problem with the missing images. Any help would be appreciated.
I should also add that the RequestStart() and HideLoadingPanel() functions as well as the currentLoadingPanel and currentUpdatedControl variables are in a separate JS file that is included in the master aspx page.
Kyle.