TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ivan Climov
1.1k
692
22.6k
How to hide a line in “gridControl1” and show this line in “
Dec 6 2018 1:26 AM
Devexpress
How to hide a line in “gridControl1” and show this line in “gridControl2” if the user changes the value of the field?
Theme update
https://www.c-sharpcorner.com/Forums/how-to-make-the-user-disappear-in-gridcontrol1-when-the-us
Scenario:
- User. Changes in gridControl1 in any line the value "???"("on") to the value "????"("off");
- Code. Hides the line in gridControl1 and displays the line in gridControl2;
I tried this using DataView, but it does not work.
How to make the scenario work?
public
partial
class
Frm13UC : UserControl
{
ConectDB conectDB;
public
Frm13UC()
{
InitializeComponent();
}
private
void
Frm12_Load(
object
sender, EventArgs e)
{
// ???????????
conectDB =
new
ConectDB();
}
public
void
FillGrid_1()
{
conectDB.connect();
gridControl1.DataSource = conectDB.dv1;
gridView1.BestFitColumns();
}
public
void
FillGrid_2()
{
conectDB.connect();
gridControl2.DataSource = conectDB.dv2;
gridView2.BestFitColumns();
}
}
public
class
ConectDB
{
public
DataTable dt;
static
OleDbDataAdapter adapter;
static
OleDbCommandBuilder cmdBuilder;
static
GridControl gridControlThis;
public
DataView dv1;
public
DataView dv2;
public
ConectDB()
{
}
public
void
connect()
{
string
catBD = @
"c:\vs\csharp\Db.accdb"
;
string
conBD =
string
.Format(
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}"
, catBD);
OleDbConnection connection =
new
OleDbConnection(conBD);
connection.Open();
string
query1 =
"SELECT * FROM TableGrid_00"
;
OleDbCommand cmd1 =
new
OleDbCommand(query1, connection);
dt =
new
DataTable();
try
{
adapter =
new
OleDbDataAdapter(cmd1);
cmdBuilder =
new
OleDbCommandBuilder(adapter);
adapter.UpdateCommand = cmdBuilder.GetUpdateCommand();
adapter.InsertCommand = cmdBuilder.GetInsertCommand();
}
catch
(Exception ex)
{
string
s = ex.Message;
throw
;
}
adapter.Fill(dt);
dv1 =
new
DataView(dt);
dv1.RowFilter =
"groupWork = '???'"
;
// "on"
dv2 =
new
DataView(dt);
dv2.RowFilter =
"groupWork = '????'"
;
// "off"
}
}
Reply
Answers (
0
)
connection string express to standard in XML
What are the benefits of using RenderPage in MVC ?