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.4k
How to make the user disappear in “gridControl1” when the us
Dec 5 2018 11:17 PM
Scenario:
- User. Changes in gridControl1 in any line the valueon to the value off;
- Code. Hides the line in gridControl1 and displays the line ingridControl2;
I tried this using DataView, but it does not work.
How to make the script work?
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 = @
"z:\vs\csharp\prb\718\01_pr\01_pr\01_pr\718.01.01.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 = '???'"
;
dv2 =
new
DataView(dt);
dv2.RowFilter =
"groupWork = '????'"
;
}
}
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();
}
}
Reply
Answers (
1
)
upload large excel file sixe to sql in MVC using angularjs
connection string express to standard in XML