Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Fill Gridview from Datatable sql server

i have connection between Xamarin android with web service i need fill gridview or any tools from sql server table

now everything is ok but i need fill gridview with data

namespace AndroidWebService
{
[Activity(Label = "orderstatus", MainLauncher = true, Icon = "@drawable/icon")]
public class orderstatus : Activity
{

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.OrderStatus);

        // Get our button from the layout resource,
        // and attach an event to it
        Button butSearch = FindViewById<Button>(Resource.Id.butSearch);

        butSearch.Click += butSearch_Click;

    }



    private void butSearch_Click(object sender, EventArgs e)
    {
        var JO = FindViewById<EditText>(Resource.Id.JO);
        var QtqSlit = FindViewById<EditText>(Resource.Id.QtqSlit);


        selling.WebServiceDB ws = new selling.WebServiceDB();
        ws.OrderStatusCompleted += Ws_OrderStatusCompleted;
        ws.OrderStatusAsync(Convert.ToInt32(JO.Text));
    }


    private void Ws_OrderStatusCompleted(object sender, selling.OrderStatusCompletedEventArgs e)
    {
        var QtqSlit = FindViewById<EditText>(Resource.Id.QtqSlit);
        var QtyPcs = FindViewById<EditText>(Resource.Id.QtyPcs);
        var GridView = FindViewById<GridView>(Resource.Id.gridView1);
        string msg = "";
        if (e.Result.QtqSlit.ToString().Equals("0"))
        {
           msg = e.Result.Message;

        }
        else
        {
            QtqSlit.Text = "" + e.Result.QtqSlit;
            QtyPcs.Text = "" + e.Result.QtyPcs;
           //GridView. 
        }
        var callDialog = new AlertDialog.Builder(this);
        callDialog.SetTitle("Notify");
        callDialog.SetMessage(msg);
        callDialog.SetNeutralButton("Ok", delegate {

        });
        callDialog.Show();
    }



}

}

Sign In or Register to comment.