Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Hello!

Basically I'm following the example http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesusercontrolformtemplate.html. Editing an existing data row is ok.

What I don't want is that when I add a new record that I have to fill up the DropDownList with a dummy value that is than initially selected in the popup (like in the example and described as the codeless way under http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesusercontrolformtemplate.html last section.

So my code look like this in the aspx-File (no changes in code behind):
<asp:DropDownList ID="test" runat="server" SelectedValue='<%# Bind("status") %>' >
    <asp:ListItem Text="offen"></asp:ListItem>
    <asp:ListItem Text="geschlossen"></asp:ListItem>
</asp:DropDownList>

In my case, there are only 2 values possible ("open case", "closed case") and when I add a new record, "open case" should be selected. With no changes, I get an JScript-Error that there is no item in the itemlist for the selected value.

When I try http://www.telerik.com/help/aspnet-ajax/grdinsertingvaluesusercontrolformtemplate.html section "Setting predefined values for controls inside FormTemplate on item insertion (both suggestions), I get the same error, but now in that moment the data binding in the aspx-File happens.

What I'm doing wrong???

Michael

Iana Tsolova
Telerik team
 answered on 22 Feb 2010
1 answer
88 views
This skin would do the best practises for color contrast etc for WCAG 2, Section 508 accessibility.

If possible, assigning to this skin would also disable any and all features that are questionable about passing a rigorouse 508 review by some one that got up on the wrong side of the bed after a horrible night.

For example:
  • Disables most if not all of Javascript functionality, animations, etc

The big win is simple:  if someone develops a site and give the user the option to declare themself needing accessibility, the site is now skinned for accessibility and everything auto-adjusts.  This would be a major win for cost-reduction in government and education sites, etc...

Alex Gyoshev
Telerik team
 answered on 22 Feb 2010
3 answers
237 views

Hi,

I am using Hierarchy mode of the radgrid with setting property HierarchyLoadMode

 

="Client".

Following code is used for filter expression.

 

 

If Assembly.GetAssembly(GetType(ScriptManager)).FullName.IndexOf("3.5") <> -1 Then

 

    radGridMenu.MasterTableView.FilterExpression =

"it[""ParentId""] = Convert.DBNull"

 

 

Else

 

    radGridMenu.MasterTableView.FilterExpression =

"ParentId IS NULL"

 

 

 

End If

But it throws an error: No applicable indexer exists in type 'Menu'.

I am using framework 3.5 and migrating from telerik old version to latest version.
Please let me know you have any other solution for this.

Thanks,
Sarang

 

Yavor
Telerik team
 answered on 22 Feb 2010
3 answers
155 views
Hi everyone,

Does anyone know if it's easily possible to hide the filter row in a RadGrid when in edit mode?

Thanks,

Steve
Alessandra C
Top achievements
Rank 1
 answered on 22 Feb 2010
2 answers
152 views
Hi -

I'm attempting to use the radCaptcha control in a WSS 3.0 application and running into some issues.  The use case is for users to request login credentials by filling out a form (with the captcha) and getting credentials emailed to them later.  Given that the user is unauthorized, I'm assuming that I need to add a <location> block to the application's web.config for the captcha image handler, but I have no idea where that guy lives in a sharepoint environment.

Thanks,
JLS
Chris
Top achievements
Rank 2
Veteran
 answered on 22 Feb 2010
2 answers
150 views
I've a page to add type of an event, with a colorpicker.
<telerik:RadColorPicker runat="server" ID="RadColorPicker1" Preset="Standard" showicon="true" width="300px" EnableEmbeddedSkins="false"/> 

before i save the selectedcolor to database, i change the color to html color as below:
ColorTranslator.ToHtml(RadColorPicker1.SelectedColor) 

now, i wanted to add another page for edit type and i tried to get the color code from database display at the colorpicker :
RadColorPicker1.SelectedColor = System.Drawing.ColorTranslator.FromHtml(color)

but, the colorpicker didn't display the color i set. Anything i left out?
----------
i've found the problem. thanks
Iry Lee
Top achievements
Rank 2
 answered on 22 Feb 2010
1 answer
107 views
The docs for RadListBox don't mention, in the client-side entries, access to the attributes collection.

--
Stuart
T. Tsonev
Telerik team
 answered on 22 Feb 2010
1 answer
141 views
Hi Everybody,

I've tryied to solve a problem involving radcalendar and ajaxpanel where up to now I didnt know how to solve this problem. I'm going to explain the scenario...

There is a page where there are two panels. First panel,  there are a radcalendar with a button. On second panel, there are  two listboxes, two, buttons, radgridview...

the problem is... On second panel, there is a cancel button. When the user clicks on this button it is setted visible true for first panel and visible false for second panel. Then the user can edit the dates that he/she selected.. The problem is after the ser clicks on cancel button, the radcalender doesnt permit the user clicks nothing date, like the date arent enables...
 
Then I had an idea two move the ajaxpanel another place and then the user can know how to edit them, however, when the user clicks on cancel buttons the controls that be inside on first painl dont show to user...

This happends because the first painle is outside the ajaxpanel just second panel is inside it.

How Can i show the controls of first panel ??

the following code that I wrote...

<table class="MarginTopConteudo" cellspacing="0" cellpadding="0" width="740" align="center" 
                                        border="0">  
                                        <tr> 
                                            <td class="cadmsg">  
                                                <asp:ValidationSummary ID="ValidationSummary2" runat="server" DisplayMode="List" /> 
                                                <asp:Label ID="lblMensagem" runat="server" Text="Label" Visible="false" CssClass="cadlbl"></asp:Label> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td style="padding-top:10px; padding-bottom:20px;">                                                      
                                                        <asp:Panel ID="pnlData" runat="server">                              
                                                                                                            
                                                        <table width="740" cellspacing="0" cellpadding="0" align="center" border="0">  
                                                            <tr> 
                                                                <td align="right" width="500">  
                                                                    <telerik:RadCalendar ID="clrPeriodoEscala" runat="server" Font-Names="Arial,Verdana,Tahoma" 
                                                                        ForeColor="Black" Style="border-color: #ececec" EnableViewSelector="true"   
                                                                        CultureInfo="Portuguese (Brazil)" FocusedDate="2009-11-11"   
                                                                        RangeMinDate="2009-11-11" SelectedDate="" Skin="Web20"   
                                                                        FastNavigationNextImage="/Web20/Calendar/fastNavRight.gif"   
                                                                        FastNavigationPrevImage="/Web20/Calendar/fastNavLeft.gif"   
                                                                        NavigationNextImage="/Web20/Calendar/arrowRight.gif"   
                                                                        NavigationPrevImage="/Web20/Calendar/arrowLeft.gif">  
                                                                        <DisabledDayStyle CssClass="calendarHolidays" /> 
                                                                    </telerik:RadCalendar> 
                                                                </td> 
                                                                <td class="cadlbl" align="left" width="240" valign="bottom" style="padding-left:20px; padding-bottom:0px;">      
                                                                    <asp:Button ID="btnCriarEscala" runat="server" CssClass="cadbutton100" Text="Criar Escala" OnClick="btnCriarEscala_Click"/>                                                      
                                                                </td>                                                                                                                                                                                             
                                                            </tr>                                                                                                                                                                      
                                                        </table>                                                      
                                                    </asp:Panel> 
                                                                                                      <rada:RadAjaxPanel ID="RadAjaxPanel2" runat="server" ClientEvents-OnRequestStart="OnRequestStart" 
                                                    LoadingPanelID="lpaCadastro">     
                                                                                                                                                             
                                                        <asp:Panel ID="pnlListHorarioColaboradores" runat="server"></asp:Panel> 
                                                        <asp:HiddenField ID="txtHiddenColaboradores" runat="server" /> 
                                                      
                                                         
                                                        <asp:Panel ID="pnlHoraColaborador" runat="server">   
                                                                                                                                                              
                                                            <table width="740" cellspacing="0" cellpadding="0" align="center" style="border: 1px solid black">  
                                                                <tr> 
                                                                    <td class="cadlbl"  width="190px" style="padding-top: 20px; padding-left:10px;">  
                                                                        <asp:Label ID="lblHorarios" runat="server" Text="Horários:"></asp:Label> 
                                                                        <asp:RequiredFieldValidator ID="rfvHorarios" runat="server" ControlToValidate="lstHorarios" 
                                                                            ErrorMessage="Campo Obrigatório: Horarios." InitialValue="0" 
                                                                            SetFocusOnError="True">*</asp:RequiredFieldValidator> 
                                                                    </td> 
                                                                    <td class="cadlbl"  width="350px"  style="padding-top: 20px;">  
                                                                        <asp:Label ID="lblColaboradores" runat="server" Text="Colaboradores:"></asp:Label> 
                                                                        <asp:RequiredFieldValidator ID="rfvColaboradores" runat="server" ControlToValidate="lstColaboradores" 
                                                                            ErrorMessage="Campo Obrigatório: Colaboradores." InitialValue="0" 
                                                                            SetFocusOnError="True">*</asp:RequiredFieldValidator> 
                                                                    </td>                                                                                                                                                                                              
                                                                </tr> 
                                                                <tr> 
                                                                    <td width="190px" style="padding-left:10px; padding-bottom:10px;">                                                                       
                                                                        <asp:ListBox ID="lstHorarios" runat="server" Height="250px" Width="130px" 
                                                                            CssClass="cadlstBox" SelectionMode="Single">  
                                                                        </asp:ListBox> 
                                                                    </td> 
                                                                    <td width="350px" style="padding-bottom:10px;">  
                                                                        <asp:ListBox ID="lstColaboradores" runat="server" Height="250px" Width="355px" 
                                                                            SelectionMode="Multiple" CssClass="cadlstBox"></asp:ListBox>                                                                  
                                                                    </td> 
                                                                    <td class="cadlbl" align="left" width="170px" valign="bottom" style="padding-left:10px; padding-bottom:20px;">      
                                                                          &nbsp;<asp:Button ID="btnInserir" runat="server" CssClass="cadbutton100" Text="Inserir" OnClick="btnInserir_Click"/>  
                                                                          &nbsp;  
                                                                          <asp:Button ID="btnCancelar" runat="server" CausesValidation="False" CssClass="cadbutton100" 
                                                                               Text="Cancelar" Width="50px" OnClick="btnCancelar_Click" />                                                   
                                                                    </td>                                                                                                                                                                                             
                                                                </tr>                                                                                                                                                                      
                                                            </table>                                             
                                                          
                                                            <table class="MarginTopConteudo" cellspacing="0" cellpadding="0" width="740" align="center" 
                                                                    style="border: 1px solid black">  
                                                                    <tr> 
                                                                        <td align="center" colspan="3" style="padding-top:20px;">  
                                                                            <!--   
                                                                            <rad:RadGrid ID="radGridHorariosColaboradores" runat="server" AllowPaging="True" AllowSorting="True" 
                                                                                AutoGenerateColumns="False" CssClass="dtg" GridLines="None" Skin="None" Width="100%" Height="250px" 
                                                                                OnItemCommand="radGridHorariosColaboradores_ItemCommand" OnItemDataBound="radGridHorariosColaboradores_ItemDataBound" 
                                                                                OnNeedDataSource="radGridHorariosColaboradores_NeedDataSource">  
                                                                                <GroupHeaderItemStyle CssClass="dtgGroupHeader"></GroupHeaderItemStyle> 
                                                                                <GroupPanel Text="">  
                                                                                    <PanelStyle CssClass="dtgGroupPanel"></PanelStyle> 
                                                                                    <PanelItemsStyle CssClass="dtgGroupPanelItem"></PanelItemsStyle> 
                                                                                </GroupPanel> 
                                                                                <AlternatingItemStyle CssClass="dtgItemStyle"></AlternatingItemStyle> 
                                                                                <ItemStyle CssClass="dtgItemStyleAlternate"></ItemStyle> 
                                                                                <HeaderStyle CssClass="dtgHeaderStyle"></HeaderStyle> 
                                                                                <MasterTableView> 
                                                                                    <NoRecordsTemplate> 
                                                                                        <div> 
                                                                                            <table cellpadding="0" cellspacing="0" height="250" width="100%">  
                                                                                                <tr> 
                                                                                                    <td class="cadlbl">  
                                                                                                        <% = FrameWork.BusinessLayer.Idioma.BLIdiomas.TraduzirMensagens(FrameWork.Model.Idioma.Mensagens.CONSULTA_SEM_RETORNO) %> 
                                                                                                    </td> 
                                                                                                </tr> 
                                                                                            </table> 
                                                                                        </div> 
                                                                                    </NoRecordsTemplate> 
                                                                                    <PagerTemplate> 
                                                                                        <table align="center" border="0" cellpadding="5" cellspacing="0" class="pag" height="15" 
                                                                                            width="100%">  
                                                                                            <tr> 
                                                                                                <td align="center" valign="center">  
                                                                                                    <asp:Panel ID="pnlPaginaAtual" runat="server" DefaultButton="btnIr">  
                                                                                                        <asp:ImageButton ID="imgPrimeira" runat="server" CausesValidation="false" CommandArgument="First" 
                                                                                                            CommandName="Page" CssClass="pagImg" ImageUrl="~/imagens/icones/ico_setaesq.gif" /> 
                                                                                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandArgument="First" 
                                                                                                            CommandName="Page" CssClass="pagLink" Enabled="True">Primeira</asp:LinkButton> 
                                                                                                        <asp:ImageButton ID="imgAnterior" runat="server" CausesValidation="false" CommandArgument="Prev" 
                                                                                                            CommandName="Page" CssClass="pagImg" ImageUrl="~/imagens/icones/ico_setaesq2.gif" /> 
                                                                                                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandArgument="Prev" 
                                                                                                            CommandName="Page" CssClass="pagLink" Enabled="True">Anterior</asp:LinkButton>&#160;&#160;  
                                                                                                        <asp:Label ID="Label3" runat="server" CssClass="paglbl">| Página:</asp:Label> 
                                                                                                        <cc1:FWMascara ID="FWMascara1" runat="server" AutoPostBack="False" CssClass="pagtxtbox" 
                                                                                                            Mascara="NUMERO" MaxLength="4" Text='<%# (int)(DataBinder.Eval(Container, "OwnerTableView.CurrentPageIndex")) + 1 %>' 
                                                                                                            Width="50px"></cc1:FWMascara> 
                                                                                                        <asp:Label ID="Label4" runat="server" CssClass="paglbl">de</asp:Label> 
                                                                                                        <asp:Label ID="Label6" runat="server" CssClass="paglbl" Enabled="True"><%#DataBinder.Eval(Container, "Paging.PageCount").ToString()%></asp:Label> 
                                                                                                        <asp:LinkButton ID="btnIr" runat="server" CommandName="IrPagina" CssClass="pagLink">Ir</asp:LinkButton> 
                                                                                                        <span class="paglbl">&#160;|&#160;</span> 
                                                                                                        <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandArgument="Next" 
                                                                                                            CommandName="Page" CssClass="pagLink" Enabled="True">Próxima</asp:LinkButton> 
                                                                                                        <asp:ImageButton ID="imgProxima" runat="server" CausesValidation="false" CommandArgument="Next" 
                                                                                                            CommandName="Page" CssClass="pagImg" ImageUrl="~/imagens/icones/ico_setadir2.gif" /> 
                                                                                                        <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandArgument="Last" 
                                                                                                            CommandName="Page" CssClass="pagLink" Enabled="True">Última</asp:LinkButton> 
                                                                                                        <asp:ImageButton ID="imgUltima" runat="server" CausesValidation="false" CommandArgument="Last" 
                                                                                                            CommandName="Page" CssClass="pagImg" ImageUrl="~/imagens/icones/ico_setadir.gif" /> 
                                                                                                    </asp:Panel> 
                                                                                                </td> 
                                                                                            </tr> 
                                                                                        </table> 
                                                                                    </PagerTemplate> 
                                                                                    <Columns>                                                                                      
                                                                                        <rad:GridBoundColumn DataField="HorarioColaborador" HeaderText="Horários" SortExpression="HorarioColaborador" 
                                                                                            UniqueName="HorarioColaborador">  
                                                                                            <ItemStyle Width="5%"></ItemStyle> 
                                                                                        </rad:GridBoundColumn> 
                                                                                        <rad:GridBoundColumn DataField="NomesColaboradores" HeaderText="Colaboradores" SortExpression="Colaboradores" 
                                                                                            UniqueName="Colaboradores">  
                                                                                            <ItemStyle Width="25%"></ItemStyle> 
                                                                                        </rad:GridBoundColumn>                                                                        
                                                                                        <rad:GridBoundColumn DataField="CodigosColaboradores" SortExpression="CodigosColaboradores" UniqueName="CodigosColaboradores" 
                                                                                            Visible="false">                                                                                  
                                                                                        </rad:GridBoundColumn> 
                                                                                        <rad:GridTemplateColumn UniqueName="TemplateColumn" Visible="False">  
                                                                                            <ItemStyle HorizontalAlign="Center" Width="5%"></ItemStyle> 
                                                                                            <ItemTemplate> 
                                                                                                <asp:ImageButton ID="Editar" runat="server" AlternateText="Editar" CausesValidation="False" 
                                                                                                    CommandArgument='<%# DataBinder.Eval(Container.DataItem, "IdEscalacao") %>' CommandName="Editar" 
                                                                                                    ImageUrl="%%PATH%%/imagens/icones/ico_editar.gif" ToolTip="Editar"></asp:ImageButton> 
                                                                                            </ItemTemplate> 
                                                                                        </rad:GridTemplateColumn>    
                                                                                        <rad:GridBoundColumn DataField="Bloqueado" SortExpression="Bloqueado" 
                                                                                            UniqueName="Bloqueado" Visible="false">  
                                                                                            <ItemStyle Width="5%"></ItemStyle> 
                                                                                        </rad:GridBoundColumn>                                                                                 
                                                                                    </Columns> 
                                                                                    <RowIndicatorColumn Visible="False">  
                                                                                        <HeaderStyle Width="20px" /> 
                                                                                    </RowIndicatorColumn> 
                                                                                    <ExpandCollapseColumn Resizable="False" Visible="False">  
                                                                                        <HeaderStyle Width="20px" /> 
                                                                                    </ExpandCollapseColumn> 
                                                                                </MasterTableView> 
                                                                            </rad:RadGrid> 
                                                                            <!-- ********************* END: RADGRID ************************** --> 
                                                                        </td> 
                                                                    </tr> 
                                                                </table>                                                              
                                                            </asp:Panel> 
                                                            <!-- ********************* END: PAINEL HORA COLABORADOR ************************** -->                              
                                                    </rada:RadAjaxPanel>                                                                                                                                                                                                   
                                            </td> 
                                        </tr> 
                                    </table>   

Thank you so much for attention,

Carlos
Martin
Telerik team
 answered on 22 Feb 2010
1 answer
122 views
Issue occcurred in various versions up to 2009.3.1407.35.

Just FYI to those out there that might experience the same issue.   The issue was traced down to a few bad data value.
I have a CLOB that stores the value from RadEditor which could contain HTML, for some reason for the 2 records that is causing Sys.WebForms.PageRequestManagerParserErrorException, it seems to have some kind of control character.

When loading via RadGrid the page would fail to load (other pages are fine).
After I removed the invalid character then it loaded fine.

I have AjaxMgr on RadGrid, no update panels anywhere.

I don't know if this is more of an issue with RadEditor storing invalid character or unable to reload it back to RadGrid.
Yavor
Telerik team
 answered on 22 Feb 2010
1 answer
307 views
I have followed the examples posted at

http://www.telerik.com/help/aspnet-ajax/grdselectingrowwithclick_client.html

and also looked at the posting

http://www.telerik.com/community/forums/aspnet-ajax/grid/server-side-selecting-row-on-other-grid-page.aspx

When I submit the selected grid items, I am unable to obtain the selected values from other pages on the grid.

I have tried the following code:

           int count = RadGrid1.MasterTableView.PageCount;
            for (int i = 0; i < count; i++)
            {
                RadGrid1.CurrentPageIndex = i;
                RadGrid1.Rebind();  <--- The rebinding appears to remove all selected items.
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    if (item.Selected)
                    {
                        HiddenField hdn = (HiddenField)item.FindControl("hdnFieldID");
                        int AID = int.Parse(hdn.Value);

                        // Perform action
                    }
                }
            }

If I loop through the grid it just obtains the values of the current page.

               foreach (GridDataItem item in RadGrid1.Items)
                {
                    if (item.Selected)
                    {
                        HiddenField hdn = (HiddenField)item.FindControl("hdnFieldID");
                        int AID = int.Parse(hdn.Value);

                        // Perform action
                    }
                }

How can you obtain all selected values on the RadGrid when selected rows exist on other pages?





Princy
Top achievements
Rank 2
 answered on 22 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?