Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
94 views
Hello,

I am using the AsyncUpload control on a site and we have to make the site ADA compliant. Is there a way to make this control keyboard friendly? Using Access Keys or being able to opening to select file popup with with space bar or enter key?

Thank you,
Chris Marfia
Peter Filipov
Telerik team
 answered on 16 Jan 2012
2 answers
586 views
Hello!

I'm not sure how to filter correctly RadGrid using FilterTemplates and RadButton which selects values from filters to create filtering expression. I'll explain more in the text below.

This is my RadGrid layout:

<telerik:RadGrid ID="gvDaily" runat="server" AllowPaging="True" PageSize="30" AllowSorting="True"
    EnableLinqExpressions="false" AllowFilteringByColumn="true" AutoGenerateColumns="False"
    CellSpacing="0" GridLines="None" OnNeedDataSource="gvDaily_NeedDataSource" Skin="Hay"
    OnItemDataBound="gvDaily_ItemDataBound" OnInsertCommand="gvDaily_InsertCommand"
    OnItemCommand="gvDaily_ItemCommand" OnUpdateCommand="gvDaily_UpdateCommand" OnPreRender="gvDaily_PreRender">
    <MasterTableView DataKeyNames="idDaily" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"
        Caption="Activity" TableLayout="Fixed">
        <CommandItemSettings ShowAddNewRecordButton="true" AddNewRecordText="Dodaj novi activity" />
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumnTicket" HeaderStyle-Width="50px">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="Manager" HeaderText="Manager" DataField="DailyManager"
                HeaderStyle-Width="150px" ShowFilterIcon="false" AutoPostBackOnFilter="false">
                <FilterTemplate>
                    <telerik:RadComboBox ID="rcbManagerDailyFilter" runat="server" AppendDataBoundItems="true"
                        OnSelectedIndexChanged="rcbManagerDailyFilter_SelectedIndexChanged" MarkFirstMatch="true"
                        AutoPostBack="false" Width="130px" Skin="Hay">
                    </telerik:RadComboBox>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Datum" HeaderText="Datum" UniqueName="Datum"
                DataFormatString="{0:dd.MM.yyyy.}" AutoPostBackOnFilter="true" HeaderStyle-Width="200px">
                <FilterTemplate>
                    <telerik:RadDatePicker ID="txtDatumPrijaveDailyOdFilter" runat="server" Culture="hr-HR"
                        Width="80px" Skin="Hay">
                    </telerik:RadDatePicker>
                    -
                    <telerik:RadDatePicker ID="txtDatumPrijaveDailyDoFilter" runat="server" Culture="hr-HR"
                        Width="80px" Skin="Hay">
                    </telerik:RadDatePicker>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Vrijeme" HeaderText="Vrijeme obavljanja" DataField="Vrijeme"
                HeaderStyle-Width="120px" AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="TicketNumber" HeaderText="Broj incidenta"
                DataField="TicketNumber" HeaderStyle-Width="60px" FilterControlWidth="40px" AutoPostBackOnFilter="false"
                ShowFilterIcon="false" CurrentFilterFunction="Contains">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TicketNumber") %>'>
                    </asp:Label>
                    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"
                        RelativeTo="Element" Position="MiddleRight" EnableShadow="false">
                        <%# DataBinder.Eval(Container, "DataItem.TicketOpis") %>
                    </telerik:RadToolTip>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="Tvrtka" DataField="Tvrtka" HeaderText="Tvrtka"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="false" HeaderStyle-Width="200px">
                <FilterTemplate>
                    <telerik:RadComboBox ID="rcbTvrtkaDailyFilter" runat="server" AppendDataBoundItems="true"
                        OnSelectedIndexChanged="rcbTvrtkaDailyFilter_SelectedIndexChanged" AutoPostBack="false"
                        MarkFirstMatch="true" Width="180px" Skin="Hay">
                    </telerik:RadComboBox>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Opis" HeaderText="Opis" DataField="Opis" HeaderStyle-Width="300px"
                AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="EfektivnoSati" HeaderText="Efektivno sati" DataField="EfektivnoSati"
                HeaderStyle-Width="60px" AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn UniqueName="Dolazak" HeaderText="Dolazak" DataField="Dolazak"
                HeaderStyle-Width="120px">
                <FilterTemplate>
                    <asp:RadioButtonList ID="rblDolazakFilter" runat="server" RepeatDirection="Vertical"
                        RepeatLayout="Flow">
                        <asp:ListItem>Dolazak</asp:ListItem>
                        <asp:ListItem>Nije dolazak</asp:ListItem>
                        <asp:ListItem>Sve</asp:ListItem>
                    </asp:RadioButtonList>
                </FilterTemplate>
            </telerik:GridCheckBoxColumn>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"
                ConfirmDialogType="RadWindow" ConfirmText="Brisanje activityja!" HeaderStyle-Width="60px">
            </telerik:GridButtonColumn>
            <telerik:GridTemplateColumn UniqueName="FilterColumn" AllowFiltering="False" HeaderStyle-Width="70px">
                <HeaderTemplate>
                    <telerik:RadButton ID="btnFilter" runat="server" Text="Filter" Skin="Hay" CommandName="FilterAll">
                    </telerik:RadButton>
                </HeaderTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings UserControlName="UserControls/DailyUserControl.ascx" EditFormType="WebUserControl">
            <EditColumn UniqueName="EditCommandColumn2">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

NeedDataSource event:

protected void gvDaily_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
 
            var dailyList = (from d in db.Daily
                             select d).ToList();
 
            gvDaily.DataSource = (from d in dailyList
                                  orderby d.Datum descending
                                  select new { d.idDaily, d.Biljeske, d.Datum, d.EfektivnoSati, Tvrtka = d.Ticket.Firma.Naziv, DailyManager = d.Kontakt.Ime + " " + d.Kontakt.Prezime, Ticket = d.Ticket.Opis, Vrijeme = d.VrijemeOd + "-" + d.VrijemeDo, d.VrijemeDo, d.VrijemeOd, d.Opis, d.Ticket.Zatvoren, d.Ticket.IzdanRacun, TicketNumber = d.Ticket.idNadredeniTicket + "-" + d.Ticket.RedniBroj, d.Dolazak, TicketOpis = d.Ticket.Opis }).ToList();
        }


This is the ItemCommand inside RadGrid ItemCommand event used for filtering, but it doesn't work properly. When I try to execute filtering separately (for example, when I'm filtering only "rcbManagerDailyFilter" or only "rcbTvrtkaDailyFilter") it works perfectly, but when I try to filter RadGrid using multiple filters only get my RadGrid filtered by one of those filters). Also, I'm not sure how to properly filter using RadDatePicker control.

else if (e.CommandName == "FilterAll")
{
    GridFilteringItem item = gvDaily.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
 
    RadComboBox rcbManagerDailyFilter = (RadComboBox)item.FindControl("rcbManagerDailyFilter");
    RadComboBox rcbTvrtkaDailyFilter = (RadComboBox)item.FindControl("rcbTvrtkaDailyFilter");
    RadDatePicker txtDatumPrijaveDailyOdFilter = (RadDatePicker)item.FindControl("txtDatumPrijaveDailyOdFilter");
    RadDatePicker txtDatumPrijaveDailyDoFilter = (RadDatePicker)item.FindControl("txtDatumPrijaveDailyDoFilter");
    RadioButtonList rblDolazakFilter = (RadioButtonList)item.FindControl("rblDolazakFilter");
 
    string tvrtka = rcbTvrtkaDailyFilter.SelectedItem.Text;
    string manager = rcbManagerDailyFilter.SelectedItem.Text;
    string datumPrijaveOd = (txtDatumPrijaveDailyOdFilter.SelectedDate).ToString();
    string datumPrijaveDo = (txtDatumPrijaveDailyDoFilter.SelectedDate).ToString();
 
    string expression = "";
 
    if (tvrtka != "Odaberi tvrtku")
    {
        expression += "([Tvrtka] = '" + tvrtka + "')";
    }
 
    if (manager != "Odaberi managera")
    {
        expression += " AND ";
        expression += "([DailyManager] = '" + manager + "')";
    }
 
    if (datumPrijaveOd.Length != 0)
    {
        expression += " AND ";
        expression += "([Datum] >= '" + datumPrijaveOd + "')";
    }
 
    if (datumPrijaveDo.Length != 0)
    {
        expression += " AND ";
        expression += "([Datum] = '" + datumPrijaveDo + "')";
    }
 
 
    gvDaily.MasterTableView.FilterExpression = expression;
    gvDaily.Rebind();
}

EDIT: It seems like code is ok, but the problem is that values are lost on postback. Any help on how to fix it would be appreciated.

Regards,

Hrvoje
Hrvach
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
129 views
dear All,
i hope you are doing well...
i using RAD CHART control from the attached picture (database table) , i want to make chart like the attached picture (project-schedule.gif)

i want to be the x axis is Date from tha table (from minimum date to maximum date)
and the y axis is Type

note for every type have date from and date to (i want these value to be as line between the 2 values) as shown in the chart picture.

help me please ASAP.

Best Regards.


Yavor
Telerik team
 answered on 16 Jan 2012
1 answer
70 views
Hi!

I wonder if theres a way to get all contextmenus in the editor?
Ive seen a demo where you can get a contextmenu by tagname. But I need all context menus.

I have users that can insert articles (some html) generated from RSS into the editor via a custom dialog.

I want to catch the contextmenu clicks within my rssarticle html tag. And change the normal contextmenu for an image to a context menu for the rss article with items like "Edit", "Remove". And I dont want to hard code to override contextmenus A,P,H1,TD etc. I must override all contextmenus within an article.

Is there a way to find out if a contextmenu clicks originates from within another tag?
Rumen
Telerik team
 answered on 16 Jan 2012
3 answers
198 views
When I try to make a BAR chart , I get an error message The type of column with name ... is not numeric. The data source for the chart is retrieved from SQL 2005 using this query:

SELECT DepartmentName, COUNT(*) AS departmentSummary FROM DimEmployee GROUP BY DepartmentName

which give me 2 coloums - one contains department name, one contains the number of employee in department name (please see attach image).





Ves
Telerik team
 answered on 16 Jan 2012
2 answers
94 views
Is it possible to change the Yvalue of a chart series item using a javascript funtion?

I have a pie chart that is displaying two values, i would like a value to change on the chart when the contents of a corresponding input box is changed. ie two input boxes determine the values displayed on the pie chart.

I think this can be done with C# in the code behind, but i don't know C# very well and as the page needs to be loaded into the sitefinity CMS i would like  to get pie chart and input boxes to work in a page with just html and javascript.

can it be done?

Any advice greatly appreciated.
Evgenia
Telerik team
 answered on 16 Jan 2012
1 answer
99 views
I have a RadMenuItem which holds a DropDownList. The dropdopwn is being styled using the Formdecorator.

I first had an issue with the Z-Index which I fixed (The dropdown was behind the RadMenu) - but I encountered another problem. The Drop down list is long and exceeds the size of the Menu. Therefore when selecting an item, as the list is longer then the height of the menu, the menu gets closed and only the dropdown items are visible.

Any suggestions to fix this issue?

Nick
Kate
Telerik team
 answered on 16 Jan 2012
11 answers
517 views
Hi,

I added the following styles to my web page so that I could expand the appointment height and vertically center the label in my appointment template in the timeline view (along with clearing the background image so that I could change the color of the appointments). Unfortunately, this added vertical and horizontal scroll bars that scroll only the cells, not the header row or resource column. Note that I had no scroll bars prior to this change. If it makes a difference, my timeline view is readonly.

        div.RadScheduler .rsAptContent, div.RadScheduler .rsAptIn, div.RadScheduler .rsAptMid, div.RadScheduler .rsAptOut
        {
            background-image: none !important;
            background: none;
            margin: 0px;
            padding-top: 1px;
            padding-left: 0px;
            padding-right: 0px;
            padding-bottom: 3px;
            text-align: center;
        }
Is there another way to do this?

Thanks for a great tool,
Linda
Plamen
Telerik team
 answered on 16 Jan 2012
1 answer
192 views
How to get full path in upload file control in C#... it is returning only file name in firefox browser. please help me...
Shinu
Top achievements
Rank 2
 answered on 16 Jan 2012
1 answer
109 views
Hi,
After searching around and not finding an answer I deicded to post...
Working on a project with several RadGrids in it.

The problem is the same across the board...

The code is using LinQtoSQL and Datatables...

An example would look like...
Private Sub btnSearch_Click(sender, e) handles btnSearch_Click()
DoSearch
End sub

Private Sub DoSearch()
using db as new DataContext

dim dt as new datatable
dt.columns.Add("UserName")
dt.columns.Add(UserImage")

dim users = _
from u in db.Users where u.UserName.Contains(txtSearch.Text)
Select u

for each u in users

dim dr as datarow = dt.newrow
dr.item("UserName") = u.username

if not isdbnull(u.Image) and not u.Image = "" then
dr.item("UserImage") = u.UserImage
else
dr.item("UserImage") = "Images/NoImage.gif"
end if

dt.rows.add(dr)

next

end using

RadGrid1.DataSource = dt
RadGrid1.Databind()

End Sub


If I use need data source by eliminating the databind in above and calling DoSearch in need datasource, the button click get ignored

but the larger issue is having to perform the entire search again just to page or sort...

I am not dealing with 10's of thousands of records, maybe 5k max and can pull what I need when a search is complete, but do not want to have to pull all records down just to page or sort the grid...

Short of writing a bunch of code to re-parametor the search, what is the best way to accomplish what I need with the RadGrid?


Shinu
Top achievements
Rank 2
 answered on 16 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?