DataTable dt = new DataTable();
dt.Columns.Add(
"ID");
dt.Columns.Add(
"FullName");
dt.Columns.Add(
"IsSelected");
DataRow dr = dt.NewRow();
dr[
"ID"] = "1";
dr[
"FullName"] = "Arvind";
dr[
"IsSelected"] = true;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[
"ID"] = "2";
dr[
"FullName"] = "Robin";
dr[
"IsSelected"] = true;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[
"ID"] = "3";
dr[
"FullName"] = "Kumar";
dr[
"IsSelected"] = false;
dt.Rows.Add(dr);
radGvw.DataSource = dt;
While running the application, totally 6 columns are generated. All the three columns are repeated. The columns are displaying in the order ID, FullName, IsSelected, ID, FullName, IsSelected. The IsSelected column type is textbox column in the second time.
I am new to this Telerik control. Please advice.
Regards,
Arvind Robin Kumar.
I currently have a grid with a checkbox column. When the user checks the checkbox I change the background color and that works fine but i'm unable to change the text color on the ValueChanged event of that grid.
| //Row Highlight when selected |
| GridCheckBoxCellElement cbCell = (GridCheckBoxCellElement)sender; |
| cbCell.RowElement.BackColor = System.Drawing.ColorTranslator.FromHtml("#DAFB5E"); |
| cbCell.RowElement.DrawFill = true; |
| cbCell.RowElement.ForeColor = this.radGVTables.ForeColor = Color.Sienna; |
| //I've tried this and it didn't work either. |
| cbCell.RowElement.ForeColor = Color.Sienna; |
Thank you for any help
Private Sub ShowData()
Dim i As Integer
Dim tmpWord As String
Dim tmprelateto As String
Dim itab As Integer
Dim newtab As String
myAdapter.Fill(ds,
"Dictionary")
mytable = ds.Tables(
"Dictionary")
tmprelateto =
""
tmpWord = ""
i = 0
Do
myrow = mytable.Rows.Item(rownumber)
tmpWord = Trim(myrow.Item(
"Word").ToString)
tmprelateto = Trim(myrow.Item(
"relateto").ToString)
If tmprelateto = "" Then
i = i + 1
If i = 2 Then
Exit Do
End If
RichTextBox1.Text = Trim(myrow.Item(
"DefNep").ToString)
RichTextBox2.Text = Trim(myrow.Item(
"DefEng").ToString)
rownumber = rownumber + 1
Else
newtab = Trim(myrow.Item("pref").ToString)
RadTabStrip1.Items.Add(
New TabItem(newtab))
Dim list As New ListBox
Dim rtfbox As New RichTextBox
Dim rtfbox2 As New RichTextBox
For Each ti As TabItem In RadTabStrip1.Items
ti.ContentPanel.Controls.Add(list)
ti.ContentPanel.Controls.Add(rtfbox)
ti.ContentPanel.Controls.Add(rtfbox2)
With list
.Location =
New Point(5, 3)
.Width = 132
.BorderStyle = BorderStyle.None
.Height = 117
If Trim(myrow.Item("Word").ToString) = "" Then
.Items.Add(Trim(myrow.Item("relateto").ToString))
Else
.Items.Add(Trim(myrow.Item(
"Word").ToString))
End If
End With
With rtfbox
.Location =
New Point(141, 3)
.Width = 133
.Height = 117
.BorderStyle = BorderStyle.None
.Text = Trim(myrow.Item(
"DefNep").ToString)
End With
With rtfbox2
.Location =
New Point(278, 3)
.Width = 132
.Height = 117
.BorderStyle = BorderStyle.None
.Text = Trim(myrow.Item(
"DefEng").ToString)
End With
Next
rownumber = rownumber + 1
End If
Loop
End Sub
Database Used above program looks like:
Word relateto pref DefNep DefNep
------- --------- ------ --------- ---------
A Null Null (ए) अंग्रेजी वर्णमालाको पहिलो अक्षर the first letter of the English alphabet
Null A adj. एउटा, कोही, एक कुनै व्यक्ति one, any, some
Null A prep. जब संज्ञामा उपसर्गको जस्तो यो (when used as a prefix before nouns)
Imports
Telerik.WinControls.UI
Public
Class Form1
Inherits ShapedForm
End Class
I have a PanelBar with a GroupElement which further has 5 Togglebuttons as child. I want to highlight the clicked togglebutton and make others Unhighlighted.
I am using togglestate ON/OFF property but its not working, below is my sample code.
Private Sub PanelBarElement1btnToggleButtonChild1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PanelBarElement1btnToggleButtonChild1.Click
PanelBarElement1btnToggleButtonChild1.ToggleState = Enumerations.ToggleState.On
PanelBarElement1btnToggleButtonChild2.ToggleState = Enumerations.ToggleState.Off
PanelBarElement1btnToggleButtonChild3.ToggleState = Enumerations.ToggleState.Off
PanelBarElement1btnToggleButtonChild4.ToggleState = Enumerations.ToggleState.Off
PanelBarElement1btnToggleButtonChild5.ToggleState = Enumerations.ToggleState.Off
End Sub
Many thanks in advance...............
Savan