Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
331 views
Good afternoon,

I have the following problem in my RadGrid have a column with the command button "select" to fire the SelectedIndexChanged event.
So far so good, when you click the button, it triggers the normal SelectedIndexChanged event.
The problem occurs when I select a row, without clicking on the button by clicking on the same line, and soon after I click for example on one other button, by doing this, it seems that for the button to cause a postback on the page, it triggers the SelectedIndexChanged event of RadGrid.

   <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function Lancar_Tarefa(id) {               
                window.radopen("Agenda_Tarefa_Novo.aspx?Id=" + id, "AgendaTarefa");
            }
             
            function Msg(msg, tipo) {
                window.radopen("Msg.aspx?Texto=" + msg + "&Tipo=" + tipo, "Msg");
                return false;
            }
 
        </script>
    </telerik:RadScriptBlock>
 
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnFiltrar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelAgenda" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Windows7" runat="server"></telerik:RadAjaxLoadingPanel>

       <
telerik:RadButton ID="btnFiltrar" runat="server" Skin="Web20" Text="Filtrar"
       Width="90px" style="margin-right:10px;">
<Icon PrimaryIconUrl="../../Icones/VizualizarGrid2.png" />
</telerik:RadButton>
 
<asp:Panel ID="pnGrid" runat="server">
<telerik:RadGrid ID="gridAgenda" runat="server" Width="710px" Height="462px"
                        Skin="Outlook" AutoGenerateColumns="False" CellSpacing="0"
                        GridLines="None">
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" />
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        </ClientSettings>
                        <MasterTableView>
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
                                Visible="True">
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
                                Visible="True">
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Select"
                                    FilterControlAltText="Filter column column" ImageUrl="~/Icones/Grid.gif"
                                    UniqueName="column">
                                    <HeaderStyle Width="35px" />
                                    <ItemStyle HorizontalAlign="Center" Width="35px" />
                                </telerik:GridButtonColumn>
                                <telerik:GridDateTimeColumn DataField="DFdata_inicio"
                                    FilterControlAltText="Filter DFdata_inicio column" HeaderText="Data/Hora"
                                    UniqueName="DFdata_inicio">
                                    <HeaderStyle Width="120px" />
                                    <ItemStyle Width="120px" />
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn DataField="DFid_agenda_relacionada"
                                    FilterControlAltText="Filter DFid_agenda_relacionada column" HeaderText="ID"
                                    UniqueName="DFid_agenda_relacionada">
                                    <HeaderStyle Width="50px" />
                                    <ItemStyle Width="50px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFfase"
                                    FilterControlAltText="Filter DFfase column" HeaderText="Fase"
                                    UniqueName="DFfase" Visible="false">
                                    <HeaderStyle Width="40px" />
                                    <ItemStyle Width="40px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Fase" UniqueName="Fase">
                                    <ItemTemplate>
                                        <asp:Panel ID="CorFase" runat="server" Height="20px" Width="20px" />
                                    </ItemTemplate>
                                    <HeaderStyle Width="40px" />
                                    <ItemStyle HorizontalAlign="Center" Width="40px" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="DFusuario_agenda"
                                    FilterControlAltText="Filter DFusuario_agenda column" HeaderText="Agenda"
                                    UniqueName="DFusuario_agenda">
                                    <HeaderStyle Width="85px" />
                                    <ItemStyle Width="85px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFtarefa"
                                    FilterControlAltText="Filter DFtarefa column" HeaderText="Tarefa"
                                    UniqueName="DFtarefa">
                                    <HeaderStyle Width="200px" />
                                    <ItemStyle Width="200px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFenviado_por"
                                    FilterControlAltText="Filter DFenviado_por column" HeaderText="Enviado Por"
                                    UniqueName="DFenviado_por">
                                    <HeaderStyle Width="85px" />
                                    <ItemStyle Width="85px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFcliente"
                                    FilterControlAltText="Filter DFcliente column" HeaderText="Cliente"
                                    UniqueName="DFcliente">
                                    <HeaderStyle Width="200px" />
                                    <ItemStyle Width="200px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFid_agenda"
                                    FilterControlAltText="Filter DFid_agenda column" HeaderText="DFid_agenda"
                                    UniqueName="DFid_agenda" Visible="False">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DFid_usuario_agenda"
                                    FilterControlAltText="Filter DFid_usuario_agenda column"
                                    HeaderText="DFid_usuario_agenda" UniqueName="DFid_usuario_agenda"
                                    Visible="False">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
</asp:Panel>


   Private Sub gridAgenda_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles gridAgenda.SelectedIndexChanged
        If gridAgenda.SelectedItems.Count > 0 Then
            For Each Row As GridDataItem In gridAgenda.SelectedItems
                If cmbUsuario.SelectedValue = "" Then
                    clsVariavel_Sessao.Agenda_IdUsuario = Row("DFid_usuario_agenda").Text
                    TableRetorno = clsConexao.Executar_Retornar("SELECT lcase(DFnome), lcase(DFemail) FROM TBusuario WHERE DFid_usuario = " & Row("DFid_usuario_agenda").Text)
                    clsVariavel_Sessao.Agenda_Usuario = TableRetorno(0)(0)
                    clsVariavel_Sessao.Agenda_UsuarioLogin = TableRetorno(0)(1)
                End If
                ScriptManager.RegisterClientScriptBlock(Me, [GetType](), "Tarefa", "Lancar_Tarefa(" & Row("DFid_agenda").Text & ")", True)
            Next
        End If
 
        Exit Sub
Erro:
        MensagemBox("Operação cancelada.", TipoMsg.Erro, Page)
        Call Gravar_Log_Erro(Err.Description, clsVariavel_Sessao.Erro, clsVariavel_Sessao.Default_UsuarioLogadoID, clsVariavel_Sessao.Default_UsuarioLogadoLogin, clsVariavel_Sessao.Default_UsuarioLogadoIP, clsVariavel_Sessao.SiteMaster_FormularioID, clsVariavel_Sessao.SiteMaster_urlWithSessionID, "gridAgenda_SelectedIndexChanged")
    End Sub

Leandro
Top achievements
Rank 1
 answered on 25 Jul 2012
0 answers
137 views
Hi I have a RadCombobox that is Enable Load On Demand - Handled code side.

I've attached an event to the OnClientItemsRequested event, which displays a tooltip if the text entered into the RadCombobox does not return any items. - I did it client side as i was having difficulties getting it to work by showing it from the code behind.

The majority of cases this is fine, but i've experienced it sometimes showing before any results have been returned from the database.

I have one client who is being quite insistant in telling me that he can type something, gets a tooltip showing 'No results for <his search>' when there are actually results for his search, they just haven't been returned from the database yet.

Can someone suggest how I can prevent this happening, and only show the Tooltip if no results are returned.

Here is the code for my 'checkFound' function incase you need it.

function checkFound(sender, args) {
    var count = sender.get_items().get_count()
    if (count <= 0 && sender.get_text().length > 0) {
        var tt = $find('<%=tt_searchArea_empty.ClientID %>');
        tt.set_text("No results found for '" + sender.get_text() + "'");
        tt.show();
    }
    else {
        hideAreaEmptyToolTip();
    }
}
 
function hideAreaEmptyToolTip() {
    var tt = $find('<%=tt_searchArea_empty.ClientID %>');
    tt.hide();
}

Alan T
Top achievements
Rank 1
 asked on 25 Jul 2012
2 answers
241 views
Hello,


I want to add a custom checkbox on the Upload window, checking/unchecking of which will decide something related to documents.
Is that possible somehow?

Regards,
Priya Angolkar 
Vessy
Telerik team
 answered on 25 Jul 2012
3 answers
217 views
I have a name column in my grid.
I am trying to get the value in the filter textbox for the name column.

<telerik:GridBoundColumn HeaderText="Patient Name" UniqueName="pt_name" DataField="pt_name" >
               <FilterTemplate>
                   <telerik:RadTextBox ID="RTName" runat="server" Width="200px" ClientEvents-OnValueChanged="ValueChanged" ></telerik:RadTextBox>
                       <telerik:RadScriptBlock ID="RBName" runat="server">
 
                               <script type="text/javascript">
                                   function ValueChanged(sender, args) {
                                       var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                       var Name = $find('<%# ((GridItem)Container).FindControl("RTName").ClientID %>');
 
                                       tableView.filter("pt_name", Name, "StartsWith");
                                   }                                  
                               </script>
 
                           </telerik:RadScriptBlock>
                    
               </FilterTemplate>
              </telerik:GridBoundColumn>

aspx.cs
if (e.CommandName == RadGrid.FilterCommandName)
            {
                Pair filterPair = (Pair)e.CommandArgument;
                switch (filterPair.Second.ToString())
                {
                    case "pt_Date":
                        {
                           //
                        }
                    case ("pt_name"):
                        {
                             
                            TextBox searchName = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("RTName") as TextBox;
                           search = searchName.Text + "%";
                            break;
                        }
 
                }
            }

But I am not getting the textbox control in the program. Value of 'searchName' is Null.
Please help me on this....


Soumya
Top achievements
Rank 1
 answered on 25 Jul 2012
1 answer
126 views
Hi ,

I use the RadSchedular in which i use the AdvancedEditTemplate this Schedular is inside an RadPanelBar and when i edit the appointment the edit window gets opened within the RadPanelBar . I want it to cover up the whole screen instead just the panel .

I have also found that this works fine in FireFox and does not work in IE .

I have also found that to make it work in IE (IE 9) i had to change the DOCTYPE attribute to

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
but the project im working on uses the one below and changing it to the above one will require a lot of changes to the Project.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

Also find the attached images in order to reproduce the error .
The doc.png shows the DOCTYPE being used .
The ie9opensinsidethepanelbar.png and firefox.png shows the output in the IE 9 and Firefox when using the DOCTYPE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

Thanks & Regards,
Francis P.
Ivana
Telerik team
 answered on 25 Jul 2012
2 answers
249 views
Hi all,

I have a multi column rad combo box, and the combo box having two columns. when i try to use the combo box filter that time i need to work that filter on that two columns at a time. how can i achieve this.. 
Please help..


Regards,

Prassin
Prassin
Top achievements
Rank 1
 answered on 25 Jul 2012
5 answers
235 views
Sir ,

I am new for telerik. Am using the  hierarchical  radgrid. But causing error when enableviewstate=false.
NeedDataSource called before ItemCommand.So my grid not able to fetch the proper data as its not gets the parentid in NeedDataSource.

If enableviewstate=true my hierarchical  radgrid working fine but the parent columns header goes disappers.

Am creating radgrid columns dynamically.

The main thing is that am not getting my parent ticket it first as NeedDatasource calling first than itemdatacommand.


Events are like this.

initializParentGrid() 

 protected void radrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
      ;;;;;;;;;;;;
bindGrid();
}

 protected void radrid 
_ItemCommand(object source, GridCommandEventArgs e)
    {

 if (e.CommandName == "ExpandCollapse")
        {
            GridTableView gtv = radrid 
.MasterTableView.Items[e.Item.ItemIndex].ChildItem.NestedTableViews[0];
            Telerik.Web.UI.DataKey gdka = radrid 
        .MasterTableView.DataKeyValues[e.Item.ItemIndex];


            hdnDetailTableIndex.Value = e.Item.ItemIndex.ToString();


            if (gdka != null)
                hdnParentTicketid.Value = gdka["ParentId"].ToString();


}


Please suggest.
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Jul 2012
10 answers
226 views
Hi,

I have 2 rad grids. First one is master and second one is detail. I can delete rows from both grids independently by pressing "Delete" button on toolbar above each grid. I also have "Refresh" buttons in toolbar of both grids.

The problem is with detail grid. When I delete item(s) the grid doesn't refresh. Calling Rebind method doesn't help. The only thing that helps is to press "Refresh" button in toolbar of master grid and select the row in master grid by mouse that was previously selected. After that I can see refreshed detail grid.

So, I don't need to press "Refresh" button in toolbar of master grid and select the row in master grid by mouse. I can refresh the master grid programmatically and only want to reselect the item that was originally selected also programmatically. I've tried this:

item.Selected = true;

But, it only visually selects the item in master grid and doesn't refresh the detail grid.

So, how to select the item in master grid programmatically in order to get the same effect as selecting it by mouse?

Thank you in advance.
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2012
0 answers
103 views
Hi
I have created a web site which has Master Page.
At left side there is a tree view control. after clicking on it a HTML file must be shown on right side in the content page.
I have the html files but i don't know hot show them load them into content area.
please help me.
Tooraj
Top achievements
Rank 1
 asked on 25 Jul 2012
1 answer
113 views
Hi,

I have two line series.I set the first serie color to BLUE, then I set the second serie color to RED.
I don't know why the second serie always appear BLUE. I think this might be simple but I can't visualize the solution.
Can anyone help? The code Follows below:

private void PopulateChart3(string seriesID)
{
    RadChart1.Clear();
    SapeDBDataContext db = new SapeDBDataContext();
 
    int ID = Convert.ToInt32(seriesID);
    var windh = from p in db.SAPE_WindSeries where p.id_localidade == ID where p.valorh != null select p;
    var windp = from p in db.SAPE_WindSeries where p.id_localidade == ID where p.valorp != null select p;
 
    ChartSeries s = new ChartSeries();
    s.Type = Telerik.Charting.ChartSeriesType.Line;
    s.Appearance.LabelAppearance.Visible = false;
    s.Name = "Historic";
    s.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Blue;
 
    foreach (var wi in windh)
    {
        ChartSeriesItem item = new ChartSeriesItem();
        item.XValue = Convert.ToInt32(wi.dia);
        item.YValue = Convert.ToDouble(wi.valorh);
        s.Items.Add(item);
    }
 
    ChartSeries s2 = new ChartSeries();
    s2.Type = Telerik.Charting.ChartSeriesType.Line;
    s2.Appearance.LabelAppearance.Visible = false;
    s2.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Red;
    s2.Name = "Projected";
     
 
    foreach (var wi in windp)
    {
        ChartSeriesItem item2 = new ChartSeriesItem();
        item2.XValue = Convert.ToInt32(wi.dia);
        item2.YValue = Convert.ToDouble(wi.valorp);
        s.Items.Add(item2);
    }
 
    RadChart1.Series.Add(s);
    RadChart1.Series.Add(s2);
}

Thanks,

Marcio Nascimento
Maxime
Top achievements
Rank 1
 answered on 25 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?