How to avoid receive incomplete packet?

Hi, I am using visual studio to get data packet from xbee coordinator.I am using delay to give more time serial port to receive data, to avoid it receive incomplete data, but however, sometimes it is still receive incomplete packet information. My coding as below:

Thread.Sleep(sec); // give time for serial port to read all data.
int numBytes = serialPort1.BytesToRead;
GlobalVar.ATAR_R = new byte[numBytes];
serialPort1.Read(GlobalVar.ATAR_R, 0, GlobalVar.ATAR_R.Length);

anyone know how to avoid receiving incomplete data?

It would be better for you to just put the read in a while loop and keep reading till there are no more bytes in the buffer.

Is there any method that can return true when there is data in serial port? or return false when there is no data.

No, the radio does not offer an IO line for that function. Think of the radio as nothing more than a serial cable with a buffer. How would you get data from a Serial cable?

then use if(serialPort1.BytesToRead>0)?

Yes something like that.

but if i dont put delay on it, it didnt get any data from serial buffer.

Try this, Hold off RTS flow control.
Assert RTS flow control and read the serial port.
If no data, De-assert RTS flow control. If there is data, continue reading serial port till their is no more data to read. Then De-assert RTS flow control.

You can put this in a while loop so your code can do other things while you keep checking the port.