hi,
in a winforms app, i am using a RadGridView with MultiSelect = true and i am trying to create a column with check-boxes that will be checked for each row that is selected.
i want this column to work in both ways:
1) the check-boxes should update themselves each time the list of selected rows is changed.
2) the user should be able to select additional rows by checking the check-boxes in this column.
currently i was able to implement the first request (the check-boxes are updating themselves according to the selected rows), but not the second one.
i subscribed to the SelectionChanged event of the grid, i unchecked the previously selected check-boxes and then checked the ones from the currently selected rows. here is the code:
private readonly List<GridViewRowInfo> previouslySelectedRows = new List<GridViewRowInfo>();
private void HandleGridSelectionChanged(object sender, EventArgs e)
{
UnCheckPreviouslySelectedRows();
CheckCurrentlySelectedRows();
StoreCurrentlySelectedRows();
}
private void UnCheckPreviouslySelectedRows()
{
foreach (GridViewRowInfo row in previouslySelectedRows)
{
row.Cells["Select"].Value = false;
}
}
private void CheckCurrentlySelectedRows()
{
IEnumerable<GridViewCellInfo> cells = radGridView1.SelectedRows
.Select(x => x.Cells["Select"]);
foreach (GridViewCellInfo cell in cells)
{
cell.Value = true;
}
}
private void StoreCurrentlySelectedRows()
{
previouslySelectedRows.Clear();
previouslySelectedRows.AddRange(radGridView1.SelectedRows);
}
did someone implement something similar?
can someone help me with the second task (to let the user select/unselect rows by checking/unchecking the check-boxes)?
thank you,
alez
I use Telerik WinForm DateTimePicker.
I can customize it with below code:
Font headerFont = new Font( "Arial", 9.0f, FontStyle.Bold );Font datesFont = new Font( "Arial", 9.0f, FontStyle.Italic );RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;RadCalendarElement calendarElement = calendar.CalendarElement as RadCalendarElement; calendarElement.CalendarNavigationElement.Font = headerFont; calendarElement.CalendarNavigationElement.ForeColor = Color.Yellow; calendarElement.CalendarNavigationElement.BackColor = Color.White; calendarElement.CalendarNavigationElement.BackColor2 = Color.Gray; calendarElement.CalendarNavigationElement.BackColor3 = Color.DarkGray; calendarElement.CalendarNavigationElement.BackColor4 = Color.Gainsboro; calendarElement.CalendarNavigationElement.BorderColor = Color.DarkGray;MonthViewElement monthView = calendarBehavior.Calendar.CalendarElement.CalendarVisualElement as MonthViewElement;foreach ( RadItem item in monthView.TableElement.Children ){ item.Font = datesFont;}int outint;foreach ( CalendarCellElement cell in ( ( MonthViewElement ) calendarBehavior.Calendar.CalendarElement.Children[ 0 ].Children[ 2 ] ).TableElement.Children ){if ( !int.TryParse( cell.Text, out outint ) ){ cell.Font = new Font( this.radDateTimePicker1.Font.FontFamily, 12 );}}
How can I change the month select font?
and also i want set these customization when navigation and select month in zoom or popup
Could you help me?
Hi
1. If the current filter output has no results, what is the proper way to update the datasource of virtualgrid so that it shows no data message and when the filter is reset, it properly populates the virtualgrid again. I am unable to do so; once an empty dataset is set as source, I am unable to repopulate the virtualgrid when the filter is removed. Can you provide an example which uses datatable as datasource rather than a list (as shown in other examples).
2. I want to also add my own custom filtering option to imeplement a regex based filtering (similar to contains,startswith etc).How can I do this.
3. The examples and docs show that data must be re-fetched from the database to update the grid. Since I have millions of rows, I want to know what is the better choice for filtering - re-fetching the data from the database or filtering in-app using LINQ?
Thanks.
I need to be able to programmatically get a list of the column headers that are currently being displayed in the grid. I.e. my grid has 8 columns; however, the user may have changed the order and hidden some of the remaining columns (via the column chooser).
How do I ask the grid to give me the columns currently displayed and in left to right order?
Hi
I have two radlistviews in a radpageview control in stack viewmode. Both the listviews can potentially have large amounts of data (> 5 million rows) simultaneously. Both the lists need to be loaded when application starts and display a flat list of items (without grouping and sorting) but I need the filtering functionality.
1. I want to show a waiting sign (or a progressbar if possible) so that the user knows he has to wait for the list to load before starting any interactions.It will be good if the lists can be populated in chunks rather than all at once.
2. I want display the details of the selected item when the user double clicks or press enter key on any dataitem. How do I achieve this.
3. I feel ashamed to ask this one - Can I access the selected item text anytime I need it directly from the control or I can only access it on some event and need to store it somewhere for later use?
4. I load the data to populate the lists from the database as dataset using async/await method.The step where I assign the dataset as datasource to listview is very time consuming and makes my application hang.I am not binding the data to the lists as described in the docs here. I simply set the datasource, datamember and displaymember properties.
From a performance perspective, is it a better approach to bind the data as described in the docs?
Please suggest a high performance solution so that my app does not hang or freeze and can easily handle data upto 10 million items per list at least.
Thanks.
Hello --
I am using the following to populate a datagrid and to setup hierarchical relationships for a parent/child grid:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
FlexEDIEntities db =
new
FlexEDIEntities();
var gridData = (from d
in
db.billing_transactions
where d.status == 1
select
new
{
d.Id,
d.stop_details.con_name,
d.stop_details.con_address1,
d.stop_details.con_city,
d.weight_billed,
d.base_amount,
count = d.billing_transaction_accessorial_charge.Count
}).ToList();
main_grid.DataSource = gridData;
if
(
this
.main_grid.Relations.Count == 0)
// does not exist yet
{
GridViewRelation relation =
new
GridViewRelation(
this
.main_grid.MasterTemplate);
relation.ChildTemplate = accessorial_template;
relation.RelationName =
"TransToCharges"
;
relation.ParentColumnNames.Add(
"Id"
);
relation.ChildColumnNames.Add(
"billing_transaction_id"
);
this
.main_grid.Relations.Add(relation);
}
}
I have a lot of these to do in this project so I am trying to not have to have a bunch of extra data sources in the project.
It is not necessary that the datagrid update the underlying data source as edits will be handled by dedicated screens.
Can I set up the child data source using a linq query, either by modifying the one above or having a second one that is dedicated for the child relationship?
Thank you --
Joe
How can I get word by word from RadRichtextbox ? For instance:
---------------------------------------------------------
%
{#Program}{toollist}
G0 G90 X49 {N_block}
---------------------------------------------------------
I need follow result. Sometimes I have spaces between word sometimes not.
So I think I have to split between all ABCDE...XYZ and between { } characters.
word[1]="%"
word[2]="{#Program}"
word[3]="{loollist}"
word[4]="G0"
word[5]="G90"
word[6]="X49"
word[7]={N_block}
Hi,
I want to know about the license for Winforms per developer means ? What are the benefits if i buy this license ?
Thanks.