Hi all,
Can I format a cell value with underline in textbox column of a
According to this link, http://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells, only 4 style properties can be set:
Fill
Border
Font
ForeColor
Best,
Tri Nguyen
I tried to use GridView in Master/Details Mode to get data from MongoDb Server.
And as the pic shows, I get the Id and the name from a Collection of Users, then I Iterate the parent Rows to get the Id and I fetch in the 2nd Colection of Product to get the details of each user.
In the server, the 1st user have only 1 product but in the pic it show it 3 times with 2 tables.
So how to get the right results and how work with Master/Detail GridView
namespace
TelerikGridView
{
public
partial
class
Form2 : Form
{
List<WatchTblCls> wts;
List<UserCls> user;
List<SymboleCls> symb;
public
Form2()
{
InitializeComponent();
wts =
new
List<WatchTblCls>();
user =
new
List<UserCls>();
symb =
new
List<SymboleCls>();
}
private
async
void
button1_Click(
object
sender, EventArgs e)
{
// add user into datagridview from MongoDB Colelction Watchtbl
var client =
new
MongoClient(
"mongodb://servername:27017"
);
var database = client.GetDatabase(
"WatchTblDB"
);
var collectionWatchtbl = database.GetCollection<BsonDocument>(
"Watchtbl"
);
var collectionUser = database.GetCollection<BsonDocument>(
"Users"
);
//wts = await collectionWatchtbl.Find(x => true).ToListAsync();
//Get User Data
var filter =
new
BsonDocument();
using
(var cursor = await collectionUser.FindAsync(filter))
{
while
(await cursor.MoveNextAsync())
{
var batch = cursor.Current;
foreach
(var document
in
batch)
{
user.Add(
new
UserCls()
{
Id = ObjectId.Parse(document[
"_id"
].ToString()),
Name = document[
"Name"
].ToString()
});
}
}
}
//Get WatchTbl Data
using
(var cursor = await collectionWatchtbl.FindAsync(filter))
{
while
(await cursor.MoveNextAsync())
{
var batch = cursor.Current;
foreach
(var document
in
batch)
{
wts.Add(
new
WatchTblCls()
{
Id = ObjectId.Parse(document[
"_id"
].ToString()),
UserId = document[
"userId"
].ToString(),
WID = document[
"wid"
].ToString(),
Name = document[
"name"
].ToString()
//Symbole
});
}
}
}
this
.radGridView1.DataSource = user;
this
.radGridView1.Columns[
"fbId"
].IsVisible =
false
;
this
.radGridView1.Columns[
"Pass"
].IsVisible =
false
;
}
GridViewTemplate childTemplate;
private
GridViewTemplate CreateChildTemplate()
{
childTemplate =
new
GridViewTemplate();
this
.radGridView1.Templates.Add(childTemplate);
GridViewTextBoxColumn column =
new
GridViewTextBoxColumn(
"wid"
);
childTemplate.Columns.Add(column);
column =
new
GridViewTextBoxColumn(
"name"
);
childTemplate.Columns.Add(column);
childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
return
childTemplate;
}
private
void
Form2_Load(
object
sender, EventArgs e)
{
GridViewTemplate childTemplate = CreateChildTemplate();
this
.radGridView1.Templates.Add(childTemplate);
childTemplate.HierarchyDataProvider =
new
GridViewEventDataProvider(childTemplate);
}
private
void
radGridView1_RowSourceNeeded(
object
sender, GridViewRowSourceNeededEventArgs e)
{
foreach
(GridViewRowInfo item
in
radGridView1.Rows)
{
var itll = item.Cells[
"id"
].Value.ToString();
foreach
(var itemWts
in
wts)
{
if
(itll == itemWts.UserId.ToString())
{
GridViewRowInfo row = e.Template.Rows.NewRow();
row.Cells[
"wid"
].Value = itemWts.WID.ToString();
row.Cells[
"name"
].Value = itemWts.Name.ToString();
//symbole
e.SourceCollection.Add(row);
}
}
}
}
}
public
class
WatchTblCls
{
[BsonId]
public
ObjectId Id {
get
;
set
; }
public
string
UserId {
get
;
set
; }
public
string
WID {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
List<SymboleCls> Symbols {
get
;
set
; }
}
public
class
UserCls
{
[BsonId]
public
ObjectId Id {
get
;
set
; }
public
string
fbId {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
string
Pass {
get
;
set
; }
}
public
class
SymboleCls
{
[BsonId]
public
ObjectId Id {
get
;
set
; }
public
string
Name {
get
;
set
; }
}
}
Hello,
I am stuck at this part for hours and not able to find an answer on how to do this. I am can do this with the normal gridview but not with radGridView.
I have a radGridView with 7 columns. And I want to get the cell value of the 6th column base on the row index of a double click. Because sometimes I click on column 2..but I don't want the cell value of column 2. I want the cell value of column 6.
Please help...Thanks...
Hi All
We are currently migrating one of our application from which is built on Third Party software( don't want to name it) to Telerik . The Application is an Windows Forms application and we need to get rid of the existing Third Party software and move that to Telerik. The existing applications has lot of Grids with features such as expand , collapse and filtering . Apart from that the application also contains Advanced Grid Grouping controls, Advanced Grid Navigation controls. It also contains Advanced Split Container's , Advanced Tab Page and Advanced Tree . I can see these controls available in Telerik UI for Windforms but not sure which would be best suitable product Telerik UI for Windforms or Telerik UI for WPF. Any Suggestions or Recommendations on the same will be highly helpful .
We have created our own class based on the RadGridView. It has been themed and coded so all of our grids look and operate the same throughout the application. One of our requirements is to have the filtering row available at the top row of each grid.
Through theming I have removed the filter description text and the filter selection button. What we are left with is an empty filter row across the top of the grid that users can type into to filter the grid.
The issue is that the default filtering is set to "Contains" and our requirements are for it to be set to "Starts with". Every thing I see on this board shows how to set the default filtering to the columns after they have been set. I need to set this on the Grid base or master template so all columns will have this setting. Is this possible or do I have to wait until all columns are set and the roll through them each individually?
Here is a snippet of the base class code.
// CoreRadGrid
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.UseCompatibleTextRendering = false;
this.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.None;
this.MasterTemplate.EnableAlternatingRowColor = true;
this.ThemeName = CoreTheme.ThemeName();
this.RootElement.UseDefaultDisabledPaint = false;
this.MasterTemplate.EnableFiltering = true;
// set Default filter
this.MasterTemplate.FilterDescriptors.Clear();
FilterDescriptor filter = new FilterDescriptor();
filter.Operator = FilterOperator.StartsWith;
filter.IsFilterEditor = true;
this.MasterTemplate.FilterDescriptors.Add(filter);
this.MasterTemplate.MultiSelect = true;
this.MasterTemplate.ViewDefinition = tableViewDefinition1;
this.AutoGenerateColumns = true;
Hi.
The two halves of the screen shot are the same tile in different states.
The first, in "No" state, has a background image that is an opaque bitmap.
The second, in "Yes" state, shows the same tile, same background image, but its foreground Image is set to an opaque plain black bitmap painted with a solid white circle containing a green tick. This is to give a gray blind effect.
The bottom part of the tile is made up of several docked lightvisualelements to create a slider button.
I notice that the gray blind seems to be painted opaquely over the other elements, which I was pleased about as I actually wanted this effect. Is tile.Image always painted opaque? But I noticed that the bottom section of the tile isn't obscured or affected by by the blind, which again is what I want, but is this because of the presence of all the docking and visual elements?.
The problem is that I wanted the white, ticked circle to appear solid. Is this not possible by painting the circle as part of the image? Or do I need to add it as yet another docked visual tile element and set that one's image to the circle?
Winforms Q2 2013 SP1
Visual Studio 2013
I recently re-installed Telerik Winforms because I moved to a new PC on Windows 10
Also I now use VS2013 instead of VS2010
On my old PC, in VS2010 I could create a new radForm in my project by clicking "Add New..." and then select radForm from the telerik tab.
In my install on VS2013 I cannot find that anywhere.
Also the Telerik menu seems more empty than on my old pc.
I included pictures of both.
The telerik controls are included in the Toolbox
I uninstalled and re-installed again, but to no avail.
Please help,
regards,
Martin
treeView_Selected event. But when I select another node , the colour of previously selected node also remains the same (I want to change the back colour of this previously selected node).
Does any one have any idea, how to achieve it?
Hello,
The RadGridView's DataSource is set to a BindingSource. I am using the RadGridView.TableElement.VScrollBar.ValueChanged event to detect once the user has scrolled to a certain point. I then grab more items from the database and load them into the BindingSource and call BindingSource.ResetBindings(false) to refresh the items in the grid. This works fine unless the user is dragging the Thumb on the ScrollBar. After the event is triggered and more items are loaded, the Thumb is still focused and drag-able, but there is a large empty area below the last row in the grid. You can scroll down a lot further than the number of rows in the grid. Calling Refresh on the GridView does not remove the white area.
Is there a way to remove the white area this creates? Or maybe a better way to accomplish Load on Demand?